How to add or remove Entire Directory users from any group in Active Directory powershell.
I am creating script to Add or remove user in AD groups.
My script is working for same domain. but If user is exist in another domain or forest, i am not able to perform action onto that.
Please help me on this.
When working with group members from another domain, or when working with groups in another domain, you need to fetch the user object or group first. There is an MSDN article that explains why and has some example code: