Windows PowerShell

How To Create 500 users in Active Directory by using Windows PowerShell.


Creating 500 Users in Active Directory by using Windows PowerShell.

Creating 500 user by using Windows PoweShell
For this procedure we have to use ForEach Loop.

In First Step
Write 1..500 in your PowerShell cmd

PS C:\Users\Administrator> 1..500

Second Step is to Write this below Script

 PS C:\Users\Administrator> 1..500 | ForEach-Object {New-ADUser -Name "micro$PSItem" -AccountPassword (ConvertTo-SecureString -AsPlainText "Superfire!!" -Force) -Enabled:$True}





After That you will get the Prompt back.
 Then Check if the users are created or not.

For this You have to Write
Get-Aduser  and then user name which you want to look.
like 
Get-Aduser micro34
In the result You will see the Enabled User micro34.

No comments:

Post a Comment