Disable Azure User through Microsoft Graph Powershell

Hi,

I am looking for a method to disable an Azure cloud account when a change to an on-premises user happens.

What I am thinking about is:

  1. The on-premises AD user has the cloud UPN filled in on extensionAttribute1 (John.Doe@company.onmicrosoft.com)
  2. When the on-premises user is disabled, a workflow should check the value of extensionAttribute1 and execute a Powershell script to disable the user in the Cloud.

I am not using Azure AD connect to sync users between on-premises and the cloud and the 2 identities are completely separate from each other.

Any suggestions?

Thanks.

Parents
  • Assuming you have your tenant configured / connected in Active Roles and all objects matched up with their Cloud equivalents, you don't have to resort to Graph for this.

    Rather, you can just set the attribute edsaAzureUserAccountEnabled to FALSE and this will disable the Cloud object for you.

  • UPDATE:

    Rather, you can just set the attribute edsaAzureUserAccountEnabled on the on-premises AD user to FALSE and this will disable the Cloud object for you.

    You do this using Set-QADUser -proxy etc. OR using the more complicated ADSI method - whichever you are most comfortable with.

Reply Children