Adding groups to member of in AD

Hey guys, I’m working on a new user script, and I posted about it before, and thanks for all the help. My question today is trying to figure out why this isn’t working, for adding to groups.

get-adgroup -filter {Name -like "$dept"} 

So the basic premise that I’m trying to work through is we have groups that are a department user. So like say “Information Technology User”. The $dept variable will have the exact name of the group, minus the user part. So in theory this should work, and find groups that have Information Technology in the name, but it doesn’t. What am I missing here? Do I need to make a new custom variable that includes the User part in it?

Thanks!

submitted by /u/rakkii
[link] [comments]

Leave a Reply