16 October 2014

Test if property exist for an object

$user = Get-ADUser username
if($user.PSObject.Properties.Match('SurnameWXZ').Count){'Yes'}
else {'No'}

No comments:

Post a Comment