IAdmHasM365AccountCondition

The IAdmHasM365AccountCondition interface represents the If has an account in Microsoft 365 condition.

Inheritance: IAdmCondition

Properties

  • Property

  • Description

  • IsOperator

  • Gets or sets a value indicating whether a user should or should not have a Microsoft 365 account to meet the condition.

Details

IsOperator

Gets or sets a value indicating whether a user should or should not have a Microsoft 365 account to meet the condition.

Examples

The following code sample creates a condition that returns true if the target object doesn't have an associated account in Microsoft 365.

PowerShell
# The $actionSet variable refers to an action set in a
# business rule, custom command, or scheduled task.

# Create condition.
$condition = $actionSet.Conditions.CreateEx("adm-HasM365AccountCondition")
$hasM365AccountCondition = $condition.GetCondition()
$hasM365AccountCondition.IsOperator = "ADM_ISOPERATOR_ISNOT"

# Save changes.
$condition.SetCondition($hasM365AccountCondition)
$condition.SetInfo()
$actionSet.Conditions.Add($condition)
C#
// The actionSet variable refers to an action set in a
// business rule, custom command, or scheduled task.

// Create condition.
IAdmBusinessRuleCondition condition = (IAdmBusinessRuleCondition)actionSet.Conditions.CreateEx(
    "adm-HasM365AccountCondition");
IAdmHasM365AccountCondition hasM365AccountCondition = 
    (IAdmHasM365AccountCondition)condition.GetCondition();
hasM365AccountCondition.IsOperator = ADM_ISOPERATOR_ENUM.ADM_ISOPERATOR_ISNOT;

// Save changes.
condition.SetCondition(hasM365AccountCondition);
condition.SetInfo();
actionSet.Conditions.Add(condition);

Requirements

Minimum required version: 2025.1

See also