Forum Discussion

Nitts's avatar
Nitts
Copper Contributor
Mar 02, 2021

PowerShell Connection on Different Domain

Hi Guys,

 

I need help with the script to remove Multiple Users from a Group on Different Domain using PowerShell. We have two domains however, my machine is on another domain. How can i leverage PowerShell Script to remove bulk users in a Group on a different domain.

 

Thanks in Advance.

  • JaksaSkelin's avatar
    JaksaSkelin
    Copper Contributor
    Hi,
    you can remove the users with the Remove-ADGroupMember command with -Server parameter.
    Example:
    Remove-ADGroupMember -Identity "myGroup" -Members JohnDoe,JaneDoe -Server DC1.2ndDomain
    Regards

Resources