We use cookies to improve your experience.
By your continued use of this site you accept such use.
For more details please see our privacy policy and cookies policy.

Script repository

Check whether Microsoft 365 user account is blocked

April 28, 2020 Views: 2441

The script can be used in Business Rules, Custom Commands and Scheduled Tasks to check whether a user is blocked from signing in to Microsoft 365 (Office 365). To use it with Adaxes, add the script to your rule, command or task using the If PowerShell script returns true condition.

Edit Remove
PowerShell
$Context.ConditionIsMet = $False

try
{
    $signInBlocked = $Context.TargetObject.Get("adm-O365AccountBlocked")
}
catch
{
    return # The user doesn't have a Microsoft 365 account
}

$Context.ConditionIsMet = !($signInBlocked)
Comments 0
Leave a comment
Loading...

Got questions?

Support Questions & Answers