Office 365 / Azure AD – Identifying Disabled Users

If you need a quick way to identify users in Azure AD that are sync’d from On-Premises AD whose accounts are disabled, you can use the following script to query the “BlockCredential” property for each user in Azure AD ($true means that the user account is disabled).

Foreach ($User in (Get-MsolUser -All))
{
If ($User.BlockCredential -eq $true)
    {
    Write-Host $User.UserPrincipalName “is disabled” -ForegroundColor Red
    }
}

Read more at source: http://blogs.technet.com/b/fromthefield/archive/2015/06/19/office-365-azure-ad-identifying-disabled-users.aspx

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top