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

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -