none
create a multiple users

    Question

  • Hi Team,

    How can create a multiple users in domain controller 2012

    please guide us on urgent basis.

    Thanks 

    • Moved by nzpcmad1 Tuesday, January 24, 2017 6:02 PM From ADFS
    Tuesday, January 24, 2017 7:37 AM

Answers

  • There are several ways to do that. The easiest one for a one-time job would be to use PowerShell and import users from CSV (http://www.adaxes.com/blog/how-to-bulk-import-ad-users-from-csv.html).

    If you want to go further than that, there are solutions that add things like scheduling, complex templates, condition-based rules, etc.: http://www.adaxes.com/active-directory_bulk-management.htm

    Wednesday, January 25, 2017 7:45 AM
  • Us below script that will create users in a single shot with required attributes which you need. 

    newuserfile.csv is a csv filename which has all users information.

    Import-Csv .\newuserfile.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 }

    Tuesday, January 24, 2017 10:30 AM
  • Hi Team,

    How can create a multiple users in domain controller 2012

    Create a CSV file with appropriate columns and values and then you can use this script:

    Import-Module activedirectory
    Import-CSV C:\Users.csv | ForEach-Object { New-ADUser -SamAccountName $_.samaccountname -UserPrincipalName ("{0}@{1}" -f $_.name,"Contoso.com") -Name $_.Name -GivenName $_.Firstname -Surname $_.Lastname -AccountPassword (ConvertTo-SecureString "Pass1234;" -AsPlainText -force) -Enabled $True }


    Mahdi Tehrani   |     |   www.mahditehrani.ir
    Please click on Propose As Answer or to mark this post as and helpful for other people.
    This posting is provided AS-IS with no warranties, and confers no rights.

    Thursday, January 26, 2017 4:08 PM
    Moderator

All replies

  • Us below script that will create users in a single shot with required attributes which you need. 

    newuserfile.csv is a csv filename which has all users information.

    Import-Csv .\newuserfile.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 }

    Tuesday, January 24, 2017 10:30 AM
  • There are several ways to do that. The easiest one for a one-time job would be to use PowerShell and import users from CSV (http://www.adaxes.com/blog/how-to-bulk-import-ad-users-from-csv.html).

    If you want to go further than that, there are solutions that add things like scheduling, complex templates, condition-based rules, etc.: http://www.adaxes.com/active-directory_bulk-management.htm

    Wednesday, January 25, 2017 7:45 AM
  • You can use CMD or Powershell to script it based on your requirements.

    This posting is provided AS IS with no warranties or guarantees , and confers no rights.

    Ahmed MALEK

    My Website Link

    My Linkedin Profile

    My MVP Profile

    Thursday, January 26, 2017 1:10 AM
  • Hi Team,

    How can create a multiple users in domain controller 2012

    Create a CSV file with appropriate columns and values and then you can use this script:

    Import-Module activedirectory
    Import-CSV C:\Users.csv | ForEach-Object { New-ADUser -SamAccountName $_.samaccountname -UserPrincipalName ("{0}@{1}" -f $_.name,"Contoso.com") -Name $_.Name -GivenName $_.Firstname -Surname $_.Lastname -AccountPassword (ConvertTo-SecureString "Pass1234;" -AsPlainText -force) -Enabled $True }


    Mahdi Tehrani   |     |   www.mahditehrani.ir
    Please click on Propose As Answer or to mark this post as and helpful for other people.
    This posting is provided AS-IS with no warranties, and confers no rights.

    Thursday, January 26, 2017 4:08 PM
    Moderator
  • Hi,

    I am checking how the issue going, if you still have any questions, please feel free to contact us.

    And if the replies as above are helpful, we would appreciate you to mark them as answers, and if you resolve it using your own solution, please share your experience and solution here. It will be greatly helpful to others who have the same question.

    Appreciate for your feedback.

    Best regards,

    Wendy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, January 30, 2017 8:03 AM
    Moderator