Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING creating bulk users AD by powershell

arshadhu

New Member
Messages
2
Reaction score
0
Points
1
Hi

kindly send the steps for creating Bulk AD users by PowerShell ( users example NV0001, NV0002)

Best regards,

Arshad
 
You can use the below powershell query to create bulk users in AD. The user names should be imported from .csv files.

Code:
Import-Csv .\usercreationfile.csv | foreach-object {
$userprinicpalname = $_.SamAccountName + “@{domainname}.com”
New-ADUser -SamAccountName $_.SamAccountName -UserPrincipalName $userprinicpalname -Name $_.name -DisplayName $_.name -GivenName $_.cn -SurName $_.sn -Department $_.Department -Path “CN=Users,DC=biogen,DC=com” -AccountPassword (ConvertTo-SecureString “Microsoft~1;” -AsPlainText -force) -Enabled $True -PasswordNeverExpires $True -PassThru }
 
You can use the below powershell query to create bulk users in AD. The user names should be imported from .csv files.

Code:
Import-Csv .\usercreationfile.csv | foreach-object {
$userprinicpalname = $_.SamAccountName + “@{domainname}.com”
New-ADUser -SamAccountName $_.SamAccountName -UserPrincipalName $userprinicpalname -Name $_.name -DisplayName $_.name -GivenName $_.cn -SurName $_.sn -Department $_.Department -Path “CN=Users,DC=biogen,DC=com” -AccountPassword (ConvertTo-SecureString “Microsoft~1;” -AsPlainText -force) -Enabled $True -PasswordNeverExpires $True -PassThru }

Thanks for your kind help.
Regards,
Arshad
 

Forum statistics

Threads
7,043
Messages
27,535
Members
17,731
Latest member
Jaco

Trending content

Back
Top