This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

List Computers from a Group which are in a specific OU

Hello,

I tried this

[PS] C:\source>Get-QADGroupMember 'Friday 1AM' | Foreach-Object { Write-Host $_.Name: (Get-QADComputer $_.DN) -includedp
roperties ou}| where {$_.ou = "ou=Disabled,ou=MITS Managed Servers,dc=ad,dc=medctr,dc=ucla,dc=edu"} | Select-Object Name
, MemberOf

1. It is giving me the member of the Group "Friday 1AM" but it is not limited to the "Disabled OU"...

2. As I have several groups

Friday 1M

Friday 2AM

Tuesday 9PM

etc...

 where I would like to verify if the machine are in the "Disabled" OU How to implement this?

?

Thanks,

Dom

Parents
  • Apparently reverse way it sowkrs at least for the first group

    Get-QADComputer -SearchRoot "ou=Disabled,ou=MITS Managed Servers,dc=ad,dc=x,dc=c,dc=e" -MemberOf 'Friday 1AM'

    trying to find a way for all groups...

    Get-QADComputer -SearchRoot "ou=Disabled,ou=MITS Managed Servers,dc=ad,dc=x,dc=c,dc=e" -MemberOf 'Friday 1AM' -OR MemberOf 'Saturday 1AM'

    does not work...

    Get-QADComputer : Cannot bind parameter because parameter 'MemberOf' is specified more than once. To provide multiple v
    alues to parameters that can accept multiple values, use the array syntax. For example, "-parameter value1,value2,value
    3".
    At line:1 char:135

    [PS] C:\source>Get-QADComputer -SearchRoot "ou=Disabled,ou=MITS Managed Servers,dc=ad,dc=m,dc=u,dc=e" -MemberO
    f 'Saturday 1AM','Friday 1AM'
    [PS] C:\source>

    No return at all...

    [PS] C:\source>Get-QADComputer -SearchRoot "ou=Disabled,ou=MITS Managed Servers,dc=ad,dc=m,dc=u,dc=e" -MemberO
    f "'Saturday 1AM','Friday 1AM'"

    Get-QADComputer : Cannot resolve directory object for the given identity: ''Saturday 1AM','Friday 1AM''.
    At line:1 char:16

    Still looking

     

    Thanks,

    Dom

Reply
  • Apparently reverse way it sowkrs at least for the first group

    Get-QADComputer -SearchRoot "ou=Disabled,ou=MITS Managed Servers,dc=ad,dc=x,dc=c,dc=e" -MemberOf 'Friday 1AM'

    trying to find a way for all groups...

    Get-QADComputer -SearchRoot "ou=Disabled,ou=MITS Managed Servers,dc=ad,dc=x,dc=c,dc=e" -MemberOf 'Friday 1AM' -OR MemberOf 'Saturday 1AM'

    does not work...

    Get-QADComputer : Cannot bind parameter because parameter 'MemberOf' is specified more than once. To provide multiple v
    alues to parameters that can accept multiple values, use the array syntax. For example, "-parameter value1,value2,value
    3".
    At line:1 char:135

    [PS] C:\source>Get-QADComputer -SearchRoot "ou=Disabled,ou=MITS Managed Servers,dc=ad,dc=m,dc=u,dc=e" -MemberO
    f 'Saturday 1AM','Friday 1AM'
    [PS] C:\source>

    No return at all...

    [PS] C:\source>Get-QADComputer -SearchRoot "ou=Disabled,ou=MITS Managed Servers,dc=ad,dc=m,dc=u,dc=e" -MemberO
    f "'Saturday 1AM','Friday 1AM'"

    Get-QADComputer : Cannot resolve directory object for the given identity: ''Saturday 1AM','Friday 1AM''.
    At line:1 char:16

    Still looking

     

    Thanks,

    Dom

Children
No Data