Welcome Forums General PowerShell Q&A Unable to Export computers from Security group inside OU

Viewing 1 reply thread
  • Author
    Posts
    • #168661
      Participant
      Topics: 8
      Replies: 7
      Points: 150
      Rank: Participant

      Hi Gents,

      I’m trying to export the list of computers from an OU by using below command.

      Get-adcomputer -filter * -searchbase “Distinguished Name of the path” | select name

      I’m able to get the results if there is no security group inside the OU but if there is any security inside OU and if the SG contains the computer objects i don’t get results.

      For example,

      Domain Name->OU->Computer = Works

      Domain Name->OU->Secuity Group->Computer = Not works

      Is how powershell works or do i make any mistake in the above command? Thanks in advance!

    • #168874
      Participant
      Topics: 2
      Replies: 1735
      Points: 3,545
      Helping Hand
      Rank: Community Hero

      Is how powershell works or do i make any mistake in the above command? Thanks in advance!

      This is how the active directory works. 😉 … the actual computer accounts are probably in another OU. But you can add any computer account to a security group. If you like to get the members of this particular group you can use Get-ADGroupMember oder Get-ADPrincipalGroupMembership.

Viewing 1 reply thread
  • The topic ‘Unable to Export computers from Security group inside OU’ is closed to new replies.