Hi,
I try to use the following commands to Set-ADUser:
$yPropertyName = "GivenName"
set-aduser Di.Wu -$yPropertyName Didi
but I get the error:
Set-ADUser : A positional parameter cannot be found that accepts argument '-GivenName'.
At line:1 char:11
+ set-aduser <<<< Di.Wu -$yPropertyName Di
+ CategoryInfo : InvalidArgument: (:) [Set-ADUser], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.ActiveDirectory.Management.Commands.SetADUser
I try to use this code in a function, so I can pass in property name and value to update the AD user. Please help.
Thanks,
Yong