Script repository
The script checks whether a user is blocked from signing in to Microsoft 365. To execute the script use the If PowerShell script returns true condition in a business rule, custom command or scheduled task configured for the User object type. The script returns $true if sign in is blocked.
$Context.ConditionIsMet = $False
try
{
$signInBlocked = $Context.TargetObject.Get("adm-O365AccountBlocked")
}
catch
{
return
}
$Context.ConditionIsMet = !($signInBlocked)
Comments 0
You must be signed in to comment.