Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

piping a list of email address into a get-user command

$
0
0

I am trying to push a list of variables into get-user, the individual components work.

$email = get-content -path "c:\temp\list.txt" | get-user $email | select-object userprincipalname,department,phone,name | format-table

get-content -path "c:\temp\list.txt" gives the list of email address, and if I take one of those email addresses and paste it into get-user $email | select-object userprincipalname,department,phone,name | format-table, the correct response is returned, however if I join the two together I get [get-user] parmemeterbindingexception.

I really feel I am missing something here

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles