What is the command to remove a user from AD group using Remove-QADGroupMember from the same domain and aswell as different domain?

What is the command to remove a user from AD group using Remove-QADGroupMember from the same domain and aswell as different domain?

Parents
  • I think the -Service switch is what you are looking for:

    Remove-QADGroupMember -Identity $MyGroup -Member $MemberName -Service "DomainA.local"

    Remove-QADGroupMember -Identity $MyGroup -Member $MemberName -Service "DomainB.local"

    If you have Active Roles and all of your domains are managed by it, you could also try this:

    # This will enumerate all instances of the group from all domains managed by Active Roles

    Get-QADGroup -proxy -Identity $MyGroup | foreach {

    Remove-QADGroupMember -proxy -Identity $_.DN -Member $MemberName 

    }

  • Thank you,

    I tried to get data from 2 managed domains with Get-QADUser with failure,

    but when I tried to do that with -proxy it's worked well  

  • That makes sense because when using the -proxy switch, what happens in the background is that the request is made to the container CN=Active Directory on your Active Roles server and then it will automatically enumerate the contents of Managed Domains under there.

    This can be good or bad depending on how many domains you have.

Reply
  • That makes sense because when using the -proxy switch, what happens in the background is that the request is made to the container CN=Active Directory on your Active Roles server and then it will automatically enumerate the contents of Managed Domains under there.

    This can be good or bad depending on how many domains you have.

Children
No Data