Reputation: 3270
Hi!
Some of my users have lastname firstname
in AD and I'd like to clean this up.
Tried with the following snippet:
get-QADUser user | Set-QADUser -DisplayName "$($_.FirstName + ' '+$_.LastName)"
but
get-QADUser user | select displayname
shows blank Displayname
What am I doing wrong here?
Upvotes: 1
Views: 1822
Reputation: 60908
In this way it works
$user = get-QADUser user
Set-QADUser -identity $user -DisplayName ( $($user.firstname) + " " + $($user.lastname) )
In your way I think the pipe doesn't work as aspected. Maybe try to do a foreach-object
Upvotes: 1