Contents tagged with New-ADUser

  • Create group of users in PowerShell

    Hello everybody,

    today I want to share just simple script, with which you can create group of users according to some rules:

    $pw = "strangePassword" | ConvertTo-SecureString -AsPlainText -Force

    for($i=1

    $i -le 320

         $i++){

           $userName = "repeatingUserName" + $i

       New-ADUser -Name $userName -GivenName $userName -AccountPassword $pw -ChangePasswordAtLogon $false -PasswordNeverExpires $true -Enabled $true

               #Remove-ADUser -Identity $userName -Confirm:$false

    }

    more