peter's tech notes

Peter A. Pirc's notes about technology

Thursday, 18 July 2013

Powershell: How to get members of AD security group

all - AD security group

Get-ADGroupMember all 

Displays only "usernames":
Get-ADGroupMember all | Select SamAccountName

Snippet for Iterating through all users

$Users=Get-ADGroupMember all | Select SamAccountName

foreach ($User in $Users)
{
Write-Host $User.SamAccountName

}
Posted by Petrov plac at 09:09 0 comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: powershell, scripts, windows
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Contact me at

linkedin
twitter
4pi.si

Interesting

Web development - toolbox
Offical page of Four PI.si

Blog Archive

  • ►  2020 (2)
    • ►  February (2)
  • ►  2019 (2)
    • ►  November (1)
    • ►  February (1)
  • ►  2016 (1)
    • ►  November (1)
  • ►  2015 (4)
    • ►  May (1)
    • ►  March (2)
    • ►  January (1)
  • ►  2014 (3)
    • ►  May (2)
    • ►  April (1)
  • ▼  2013 (3)
    • ►  August (1)
    • ▼  July (1)
      • Powershell: How to get members of AD security group
    • ►  April (1)
  • ►  2012 (9)
    • ►  September (1)
    • ►  August (1)
    • ►  July (3)
    • ►  April (2)
    • ►  January (2)
  • ►  2011 (13)
    • ►  October (2)
    • ►  September (3)
    • ►  July (3)
    • ►  June (2)
    • ►  March (1)
    • ►  January (2)
  • ►  2010 (8)
    • ►  November (1)
    • ►  October (4)
    • ►  September (2)
    • ►  July (1)

Search This Blog

About Me

Petrov plac
View my complete profile
Simple theme. Theme images by enot-poloskun. Powered by Blogger.