Removing Azure Active Directory users using Azure Cloud Shell

Share this:

Cloud Shell is one of the new features in Azure Portal, and it is accessible from virtually any browser and even from Azure App. In this Tutorial, we are going over the simple steps to list and remove accounts using Azure Cloud Shell.

Solution


In the current scenario, we have some accounts that are being synchronized between on-premises and Azure Active Directory using Azure AD Connect, since they are being synchronized we can’t just remove them using Azure Portal. A possible solution to remove such accounts, is opening Azure Cloud Shell.

Screen Shot 2017-10-06 at 6.44.20 PM

After connected and it may take a few seconds, we can first list the current users using the following command.

az ad user list

Screen Shot 2017-10-08 at 10.50.42 AM

In order to delete an account, the following command can be used. Please, replace the UPN by the user on your organization.

az ad user delete –upn-or-object-id bruce@infralab.org

Screen Shot 2017-10-08 at 10.52.51 AM

 

There are way more tasks that can be done using Azure Cloud Shell, in this Tutorial, we focused in a simple set of tasks to list and remove accounts that cannot be removed using the Azure Portal.

Written by Anderson Patricio

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange and several other certifications. Anderson has been contributing to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at ITPROCentral.com, MSExchange.org, Techgenix.com and Anderson Patricio.org (Portuguese).

Related Post

New version of Azure Backup Server introduces Mode... WOW! What a day for me! Microsoft Azure just announces new and improved features on the new version Azure Backup Server. Let’s start! They announce...
Getting the number of mailboxes per database in yo... How to create a single line PowerShell to retrieve the number of mailboxes per mailbox database in your organization. I was asked about that number in...
Windows Azure e Office365 – Validating the synchro... In this final article of this Tutorial Series we will go over the process to create an user on-premises and what we have to do on our side to enable s...
Software-Defined Networking with Windows Server an... Free online event with live QA with the WAP team: http://aka.ms/WAPIaaS Two half-days – Wednesday July 16th & Thursday July 17th – 9am-1pm PST ...