SHARE
TWEET

Untitled

a guest Jun 25th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Get-ADGroupMember -Identity $GroupGUID |
  2. ForEach-Object{
  3.     if($_.ObjectClass -eq 'User'){
  4.         # process user object
  5.         $_ | Get-ADUser -Properties DisplayName
  6.     }elseif ($_.ObjectClass -eq 'User'){
  7.         # process group
  8.         $_ | Get-ADGroup -Properties Name
  9.     }
  10. }
  11.      
  12. MemberName          ObjectGUID
  13. ----------------    ------------------
  14. Test Group          123-456-XXXX
  15. Test User           789-456-XXXX
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top