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.
PowerShell
$propertyName = "employeeID" # TODO: modify me
try
{
$currentValue = $Context.TargetObject.Get($propertyName)
}
catch
{
$currentValue = $NULL
}
$Context.ConditionIsMet = [System.String]::IsNullOrEmpty($currentValue)