Hi, I have been using the following script to add a computer to AD groups but I’m having trouble with this certain group. I believe the problem is the parentheses but I’m not sure.
Hi yes that would work and thank you. That is the exact name. I typically add multiple groups using a similar script. I guess I was curious on why no groups with the parentheses worked. This works also:
Without you showing the error you get if you get one it’s hard to say what problem you have. If you use the -match operator you should be aware of that it’s using regular expressions for comparison. Therefor charachters might not have the meaning you expect. You might read some more information about that topic - regular expressions.
BTW: When you post code please format it as code using the code tag button (pre) on the edit bar of the post editor. Thanks.