To clarify the use of $srcPwd, consider a scenario where the target object password in the target connected data system must include only 8 first characters of the source object password in the source Active Directory domain.

The following scripts implements the described scenario:

if($srcPwd.length -gt 8)

{

$srcPwd.substring(0,8)

}

else

{

$srcPwd

}

# End of the script