ML
    • Register
    • Login
    • Search
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Server 2012: PS Get-ADGroupMember

    IT Discussion
    2012 2012 r2 windows server 2012 server 2012 r2 powershell
    7
    26
    1964
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • gjacobse
      gjacobse @coliver last edited by

      @coliver said in Server 2012: PS Get-ADGroupMember:

      @gjacobse said in Server 2012: PS Get-ADGroupMember:

      Finds it

      Get-ADGroupMember "GroupName" -recursive | select name, objectclass
      

      Glad you got it. Was the recursive flag required?

      in the example I found - yes.

      dafyre 1 Reply Last reply Reply Quote 0
      • dafyre
        dafyre @gjacobse last edited by

        @gjacobse said in Server 2012: PS Get-ADGroupMember:

        @coliver said in Server 2012: PS Get-ADGroupMember:

        @gjacobse said in Server 2012: PS Get-ADGroupMember:

        Finds it

        Get-ADGroupMember "GroupName" -recursive | select name, objectclass
        

        Glad you got it. Was the recursive flag required?

        in the example I found - yes.

        The -recursive flag handles nested groups. This is a handy feature.

        1 Reply Last reply Reply Quote 1
        • travisdh1
          travisdh1 @coliver last edited by

          @coliver said in Server 2012: PS Get-ADGroupMember:

          @travisdh1 said in Server 2012: PS Get-ADGroupMember:

          @coliver said in Server 2012: PS Get-ADGroupMember:

          Did you do

          Import-Module ActiveDirectory

          ?

          One of my major pain-points with PowerShell. Why does every module have to be manually loaded. It's not like you have to load them into memory until it's actually needed.

          The new PowerShell core seems to auto import modules when you use a command from them.

          Why was that missing from day 1? Seriously!

          scottalanmiller coliver 2 Replies Last reply Reply Quote 0
          • scottalanmiller
            scottalanmiller @travisdh1 last edited by

            @travisdh1 said in Server 2012: PS Get-ADGroupMember:

            @coliver said in Server 2012: PS Get-ADGroupMember:

            @travisdh1 said in Server 2012: PS Get-ADGroupMember:

            @coliver said in Server 2012: PS Get-ADGroupMember:

            Did you do

            Import-Module ActiveDirectory

            ?

            One of my major pain-points with PowerShell. Why does every module have to be manually loaded. It's not like you have to load them into memory until it's actually needed.

            The new PowerShell core seems to auto import modules when you use a command from them.

            Why was that missing from day 1? Seriously!

            If you wanted stuff like that, you'd be using BASH.

            travisdh1 1 Reply Last reply Reply Quote 0
            • travisdh1
              travisdh1 @scottalanmiller last edited by

              @scottalanmiller said in Server 2012: PS Get-ADGroupMember:

              @travisdh1 said in Server 2012: PS Get-ADGroupMember:

              @coliver said in Server 2012: PS Get-ADGroupMember:

              @travisdh1 said in Server 2012: PS Get-ADGroupMember:

              @coliver said in Server 2012: PS Get-ADGroupMember:

              Did you do

              Import-Module ActiveDirectory

              ?

              One of my major pain-points with PowerShell. Why does every module have to be manually loaded. It's not like you have to load them into memory until it's actually needed.

              The new PowerShell core seems to auto import modules when you use a command from them.

              Why was that missing from day 1? Seriously!

              If you wanted stuff like that, you'd be using BASH.

              Whenever I'm given the choice, BASH, zsh, etc, all better than PowerShell.

              1 Reply Last reply Reply Quote 0
              • coliver
                coliver @travisdh1 last edited by

                @travisdh1 said in Server 2012: PS Get-ADGroupMember:

                @coliver said in Server 2012: PS Get-ADGroupMember:

                @travisdh1 said in Server 2012: PS Get-ADGroupMember:

                @coliver said in Server 2012: PS Get-ADGroupMember:

                Did you do

                Import-Module ActiveDirectory

                ?

                One of my major pain-points with PowerShell. Why does every module have to be manually loaded. It's not like you have to load them into memory until it's actually needed.

                The new PowerShell core seems to auto import modules when you use a command from them.

                Why was that missing from day 1? Seriously!

                Microsoft...

                1 Reply Last reply Reply Quote 1
                • dbeato
                  dbeato @travisdh1 last edited by

                  @travisdh1 said in Server 2012: PS Get-ADGroupMember:

                  @coliver said in Server 2012: PS Get-ADGroupMember:

                  Did you do

                  Import-Module ActiveDirectory

                  ?

                  One of my major pain-points with PowerShell. Why does every module have to be manually loaded. It's not like you have to load them into memory until it's actually needed.

                  No anymore, those are on old OS...

                  1 Reply Last reply Reply Quote 0
                  • gjacobse
                    gjacobse last edited by

                    Found this also:

                    get-adgroup -filter * | sort name | select Name
                    

                    Not being one to script,.. can this be used to place the result in an array and then pull a list of users from each, and export to csv?

                    Seems like it should be - simple - but while I can see it, and can't get there.

                    dafyre 1 Reply Last reply Reply Quote 0
                    • dafyre
                      dafyre @gjacobse last edited by

                      @gjacobse said in Server 2012: PS Get-ADGroupMember:

                      Found this also:

                      get-adgroup -filter * | sort name | select Name
                      

                      Not being one to script,.. can this be used to place the result in an array and then pull a list of users from each, and export to csv?

                      Seems like it should be - simple - but while I can see it, and can't get there.

                      You're almost there...

                      $myVariable=get-adgroup -filter * | sort DisplayName | select DisplayName

                      1 Reply Last reply Reply Quote 0
                      • Obsolesce
                        Obsolesce last edited by

                        I use a Linux server that is domain joined to see what groups a MS AD user is a member of. It's just way easier and faster.

                        id [email protected]

                        Done.

                        scottalanmiller 1 Reply Last reply Reply Quote 3
                        • scottalanmiller
                          scottalanmiller @Obsolesce last edited by

                          @obsolesce said in Server 2012: PS Get-ADGroupMember:

                          I use a Linux server that is domain joined to see what groups a MS AD user is a member of. It's just way easier and faster.

                          id [email protected]

                          Done.

                          I was just saying how ridiculously cumbersome this is because of Windows.

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post