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

Popular posts from this blog

java - Incorrect order of records in M-M relationship in hibernate -

ruby - Net::HTTP extremely slow responses for HTTPS requests -

c++ - Boost Spirit Parser with a vector of three strings compiling into a struct, adapt not working -