Unable to Export computers from Security group inside OU

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

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
1 month, 3 weeks ago.

  • Author
    Posts
  • #168661

    Participant
    Topics: 7
    Replies: 7
    Points: 127
    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: 1
    Replies: 1530
    Points: 2,591
    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.

You must be logged in to reply to this topic.