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

Containers on Azure – Part 2 On the previous post (see here), I talked about the concept of Containers, Azure Container Service and Azure Service Fabric. Now that you know the con...
How to move your workloads to Azure When integrating your on-premises environment with Azure, you might want to use the lift-and-shift approach to migrate some of your existing workloads...
Installing Server Management tools In this tutorial, we are going over the process to install the required software in a Windows Server 2012 or Windows Server 2012 R2 to support SMT (Se...
Using PowerShell as default option in Windows 10 m... By default in Windows 10 (well, on previous versions as well) when we either use right-click on the lower-left corner or Windows + X , we will have a ...