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 if the property is empty before modification

February 18, 2021 Views: 776

The script checks the property being modified and returns true if it is currently empty. The script should be executed in the If PowerShell script returns true condition in a business rule triggering Before updating a user.

Parameters:

  • $propertyName - Specifies the LDAP name of the property whose value will be checked.
Edit Remove
PowerShell
$propertyName = "employeeID" # TODO: modify me

try
{
    $currentValue = $Context.TargetObject.Get($propertyName)
}
catch
{
    $currentValue = $NULL
}

$Context.ConditionIsMet = [System.String]::IsNullOrEmpty($currentValue)
Comments 0
Leave a comment
Loading...

Got questions?

Support Questions & Answers