Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Checking SamAccountnames in a CSV for membership in multiple groups.

$
0
0

I am a scripting novice. I am working to improve my skills in PowerShell but am stumped on this one, which isn't hard to do.

Everyday a spreadsheet is created with of users that have completed a certain action, and need to be added to one of 3 AD groups that already have several hundred existing members in each group.  I change the spreadsheet to a *.csv for use with PowerShell.  There is a $_.EmployeeID column of employee ID numbers which are also the SamAccountNames of the users.  These users could be members of any of 4 domains in the AD forest.  It is also possible that the users are already a member of one of the 3 groups in question.  The 3 groups are all in the same OU of one of the domains.

I'm trying to use PowerShell to  check the EmployeeIDs against the three groups and flag\list\display\export a list of the Employee IDs that do not belong to any of the 3 groups.

Adding the users to one of the groups is out of scope for this question because of cases that decide which group the need to be in.  I also have the Quest AD module for PowerShell if needed.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



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