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

Azure Cloud Shell Everywhere WOW! Microsoft did it again! If you didn’t saw the announcements at the Microsoft Build 2017 Conference, you should! They announce a lot of new thing...
How to build a Disaster Recovery solution with Azu... Frequently I heard how to build a disaster recovery solution. When I heard that I always think about ASR. On my last post I talked about Azure Site Re...
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...
How to create a Virtual Network using Azure Resour... Configuring a Virtual Network and a VPN connection between Microsoft Azure and a local site using Azure Resource Manager deployment model. Solution ...