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.

Introduction

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

How to delete a Backup Vault in Azure The Backup Vault is found in the Recovery Services item and it is the repository for all protected data from Windows Backup, DPM or ASR (Azure Site Re...
Performing Backup on your DHCP Server In this Tutorial we will be checking the process to protect the DHCP Server database using the automatic configuration, Graphical User Interface and P...
Managing Federation Services–Creating a GPO to sup... In this Tutorial we are going over the process to create a Group Policy to be applied to user objects, and this policy will add the Federation Servers...
Microsoft Federation Services – The Series Hello folks, Last week we finished up a series about Federation Services where we went over the process to build the ADFS on your on-premises environ...