Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

If statement to join users to AD groups

$
0
0

Hi All,

I'm trying to create a script that does the following:

1. Copies AD group memberships from a source user to the target user

2. Checks whether the target user is a member of GroupA or GroupB

3. Then says If target user is a member of GroupA remove membership & If user is a member of GroupB remove membership.

Copying groups from other users saves a lot of work but it also puts them in a few groups they should not be in i.e. directors! If someone could help me with this I would be most grateful!

Thanks


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>