Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

CSV + Add Users to AD group based on variable

$
0
0

I have a CSV file that is a result of a powershell SQL query of a table from an HR database.  In simple terms I have two values in the CSV to help me out.  Login ID and department.  The CSV file doesn't have a group attribute.  I have researched a way to associated the department value with an active directory group however I am not having much luck.  I see a lot of scripts that add users to groups however there is always group data in the CSV.  If I had that data this all would be simple.   I am not so fortunate.  The other thought I had was a quick powershell script that would create a group column based on the evaluation of the attribute in the department column.  So Financial and Account Services Department would = Finance Staff (ad security group).   I don't even know where to begin with that one. 

Can someone point me in the right direction for associating a group with a department and adding the user to the required AD group?  Thank you in advance!


Viewing all articles
Browse latest Browse all 6937

Trending Articles