powershell - get displayname from samaccountname -
i looking way displayname
of user samaccountame
.
$username = read-host 'username' $user = get-aduser -filter {samaccountname -like $($name.displayname)$username}
i want put displayname
variable called $user
any suggestions?
$username = read-host 'username' $user = get-aduser -filter "samaccountname -eq '$username'" |select name
Comments
Post a Comment