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.
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.
After connected and it may take a few seconds, we can first list the current users using the following command.
az ad user list
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 firstname.lastname@example.org
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.