Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Importing Multiple AD Users - Powershell

$
0
0

Hello all,

I am just learning some powershell and have created a Excel file with user names to Import into powershell. The user names are mapped to the same OU which makes the import super easy.

My question is - Is there a way to dynamically import a user based on a persons role in the company? I don't want to import every user into the same OU. It would be nice to get a list from HR of 5 new hires - put them into the csv file and run the script and have them in the right OU.

I'm also curious is there a way to have the mailbox created as well?

Currently this is my script;

Add-PSSnapin Quest.activeroles.ADManagement

Import-Csv “NewUsersTemplate.csv” | ForEach-Object {

$userPrinc = $_.”Logon Username” + “@it-noob.int”

New-QADUser -Name $_.”Name” `

-ParentContainer $_.”Container” `

-SamAccountName $_.”Logon Username” `

-UserPassword $_.”SuperSauce@1...


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

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