Quantcast
Viewing all articles
Browse latest Browse all 15370

Add ad users in bulk

First I made a script for making OU in my AD, that worked fine

A txt file:

Text
_organisatie _organisatie\Directie _organisatie\IT _organisatie\Aankoop _organisatie\Verkoop _organisatie\Support _shares _shares\Directie _shares\IT _shares\Aankoop _shares\Verkoop _shares\Support 

OU Script:

Powershell
Get-ContentC:\OUStructure.txt|Foreach-Object{$domain='DC=Lcorp,DC=local'$allOU=''$ous=(Split-Path$_-Parent).Split('\')[array]::Reverse($ous)$ous|Foreach-Object{if($_.Length-eq0){return}$allOU=$allOU+'OU='+$_+','}$allOU+=$domain$NewOU=Split-Path$_-LeafNew-ADOrganizationalUnit-Name"$NewOU"-Path"$allOU"-ProtectedFromAccidentalDeletion$false}

No i want to populate these OU with users, so i mad a csv

CSV:

Text
firstname,lastname,username,password,ou...

Viewing all articles
Browse latest Browse all 15370

Trending Articles



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