How to lookup a list of users by full name only with powershell
Import-CSV C:\fullnames.csv | ForEach-Object { $filter = "Name -eq '" + $_.name + "'"; $b = Get-ADUser -Filter $filter; if($b) { $b.samaccountname; } else { "-Not found-" + $_.name ;} }
More about neonprimetime
Top Blogs of all-time
Top Github Contributions
Copyright © 2015, this post cannot be reproduced or retransmitted in any form without reference to the original post.
Showing posts with label Get-ADUser. Show all posts
Showing posts with label Get-ADUser. Show all posts
Friday, February 5, 2016
Lookup user by Full Name powershell
Lookup Users by Last Name Powershell
How to lookup a list of users by last name only with powershell
Import-CSV C:\lastnames.csv | ForEach-Object { $filter = "Name -like '*" + $_.name + "'"; $b = Get-ADUser -Filter $filter; if($b) { $b.samaccountname + "`t" + $_.name ; } else { "-No-" + "`t" + $_.name ;} }
More about neonprimetime
Top Blogs of all-time
Top Github Contributions
Copyright © 2015, this post cannot be reproduced or retransmitted in any form without reference to the original post.
Import-CSV C:\lastnames.csv | ForEach-Object { $filter = "Name -like '*" + $_.name + "'"; $b = Get-ADUser -Filter $filter; if($b) { $b.samaccountname + "`t" + $_.name ; } else { "-No-" + "`t" + $_.name ;} }
More about neonprimetime
Top Blogs of all-time
Top Github Contributions
Copyright © 2015, this post cannot be reproduced or retransmitted in any form without reference to the original post.
Get User from AD Group in powershell
How to list all names and descriptions of a user in an Active Directory Group with powershell
Get-ADGroupMember -identity "AD GROUP I WANT TO LOOKUP" | select name | export-csv -path c:\output.csv
Import-CSV output.csv | ForEach-Object { Get-ADUser -identity $_.name -Properties Description } | select name, Description
More about neonprimetime
Top Blogs of all-time
Top Github Contributions
Copyright © 2015, this post cannot be reproduced or retransmitted in any form without reference to the original post.
Get-ADGroupMember -identity "AD GROUP I WANT TO LOOKUP" | select name | export-csv -path c:\output.csv
Import-CSV output.csv | ForEach-Object { Get-ADUser -identity $_.name -Properties Description } | select name, Description
More about neonprimetime
Top Blogs of all-time
Top Github Contributions
Copyright © 2015, this post cannot be reproduced or retransmitted in any form without reference to the original post.
Subscribe to:
Posts (Atom)