Forum Discussion
jmaraviglia
Apr 02, 2025Copper Contributor
Remove computers from multiple domains from one AD group
Hello! I've tried a couple of scripts I found and still cannot remove these computers from this one AD group. The script I'm currently using is: # Import the Active Directory module
Import-M...
LainRobertson
Apr 14, 2025Silver Contributor
Hi jmaraviglia,
Either format will do.
Technically, "^cn=machine2," is just a stricter version of "=machine2," since it's using the "^cn=" to say "this computer's full path must begin with 'cn=machine2,' where "=machine2," is more relaxed and says "this computer's path simply needs to have '=machine2,' anywhere in it".
You can refer back to my first post which has the small table I added as well as a link to Microsoft's RegEx pattern documentation for a more in-depth explainer on those patterns.
Cheers,
Lain
jmaraviglia
Apr 15, 2025Copper Contributor
Thank you for all of your help, Lain. I was able to finally complete this task. I will continue to train and practice with Powershell. I can tell I have a very long way to go. :-)
Jeff