Script Repository


Check if the property is empty before modification

February 18, 2021
98

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 )
No results found.
Leave a comment