help with output of my member of list from Active directory

Welcome Forums General PowerShell Q&A help with output of my member of list from Active directory

This topic contains 11 replies, has 5 voices, and was last updated by

 
Participant
5 years, 2 months ago.

  • Author
    Posts
  • #10694

    Participant
    Points: 0
    Rank: Member

    im pretty new to PS and i need help with getting a list from the member of tab in active directory for my user names. I log into server 2008 and then open Active diretory and alos powershell on the same server. when i launch powershell what do i need to get the List of member of for my username? what are the commands. thanks

  • #10695

    Keymaster
    Points: 1,704
    Helping HandTeam Member
    Rank: Community Hero

    Windows Server 2008 doesn't come with any built-in Active Directory commands, so you would need to use the [adsi] provider, which is quite a bit more complicated. 2008R2 comes with AD commands.

    You can also install the AD commands on Win7 or Win8 by installing the RSAT. It's recommended that you do that, instead of logging on to your DC directly. The AD commands can talk to any DC Win2003 or later – although on Win2003 and Win2008, you have to install the free AD Management Gateway on at least one DC. Both the Gateway and the RSAT can be downloaded from Microsoft.

  • #10696

    Keymaster
    Points: 1,704
    Helping HandTeam Member
    Rank: Community Hero

    Oh, and from there you'd run something like

    Get-ADUser -Identity MyUserName -Prop * | Select *

    To see the MemberOf property. But this does only show direct memberships, like the tab in ADUC; it won't show nested memberships.

  • #10697

    Participant
    Points: 0
    Rank: Member

    I wanted to use Powershell on teh server itself becuase i dont have Windows 7 i have windows xp and i can not install Admin tools pack, i had admin tools pack previously but laptop crashed now not allowed to install it. there has to be someway when im logged into this domain server with powershell via RDP to run some commands in PS to get the output of memberof for my username. thanks

  • #10699

    Keymaster
    Points: 1,704
    Helping HandTeam Member
    Rank: Community Hero

    Windows Server 2008 does not contain PowerShell commands for Active Directory.

    You might look at http://technet.microsoft.com/en-us/magazine/2007.06.powershell.aspx, which discusses using PowerShell with older versions of Windows. It's basically like writing VBScript.

  • #10701

    Member
    Points: 0
    Rank: Member

    If you're only interested in your own group memberships, you could just run "whoami /groups" at a command prompt or PowerShell console.

  • #10704

    Participant
    Points: 0
    Rank: Member

    For Windows 2008 the other option is to download the free Quest cmdlets
    http://www.quest.com/powershell/activeroles-server.aspx

  • #10705

    Participant
    Points: 0
    Rank: Member

    Windows Server 2008 does not contain PowerShell commands for Active Directory. hmm that is not true i launched PS and used this command to connect to AD im logged into the remote server with PS installed on it.

    PS C:\Users\nbetzfw> Import-Module Active Directory – ran this
    then ran this

    PS C:\Users\nbetzfw> Get-ADUser nbktzfw -Properties MemberOf | Select-Object -ExpandProperty MemberOf

    worked like a charm

  • #10706

    Member
    Points: 0
    Rank: Member

    You must be running Server 2008 R2, then. That's the earliest server OS that supports the AD module.

  • #10707

    Participant
    Points: 0
    Rank: Member

    It sounds like someone has already installed the gateway & cmdlets that Don mentioned

  • #10715

    Participant
    Points: 0
    Rank: Member

    im pretty new to PS and i need help with getting a list from the member of tab in active directory for my user names. I log into server 2008 and then open Active diretory and alos powershell on the same server. when i launch powershell what do i need to get the List of member of for my username? what are the commands. thanks

    Here's a script that shows nested group membership for a user-supplied account.

    $usr=Read-Host "Enter User.Name to Query: "
    $grps=(dsquery user -name $usr | dsget user -memberof -expand)
    foreach($grp in $grps) {
        $strGRP=($grp | Sort Name | foreach {($_.Split(','))[0]}) -Join ","
        $strDONE=$strGRP
        write-host $strDone
    }
    
  • #10717

    Participant
    Points: 0
    Rank: Member

    Thanks Guys!!!

The topic ‘help with output of my member of list from Active directory’ is closed to new replies.