(Excuse me for being 2-3 years behind the PS curve :-) )
I'm trying to fix our missing UPNs. I wrote this to locate them:
get-qaduser -includedproperties userprincipalname -SearchRoot "company.com/user accounts" -sizelimit 0|where {!($_.userprincipalname -like "*@*") }
Which works great. Now I want to pipe the output to set-qaduser to populate the UPN by adding this to the above code:
|set-qaduser -userprincipalname "$($_.samAccountName)@company.com"
No matter what I try $_.samaccountname is always null. What am I missing?
\\Greg