TkFast Logo

View FAQ
Print Version

- Servers - Windows -


(posted by on 2015-08-14 13:42:39)
Powershell add users to Active Directory Windows Server 2012 ...

How to add users to Active Directory as a import from a csv file.


Solution:

    2008 Server Enable


    Features
    Add Feature
    - Windows Powershell Integrated Scripting Enviroment
    - Remote Server Admin Tools
    - Active Directory Modile for Windows Powerschell


    Active Directory Module for Windows Powerschell


    2012 enable


    Launch Powershell and put in the following command
    Set-ExecutionPolicy RemoteSigned


    Copy the excel csv file your are importing
    change to c:scripts


    c:scripts


    Import-Csv ./test.csv


    If it looks good then you will run this command


    Import-Csv ./test.csv | New-AdUser -Enable $True -AccountPassword (ConvertTo-SecureString ENTERPassword -AsPlainText -force) -City Wichita -State KS



    Import-Csv .userImport.csv | foreach-object {
    New-ADUser -Name $_.DisplayName -UserPrincipalName $_.UserPrincipalName -SamAccountName $_.Username -GivenName
    $_.GivenName -DisplayName $_.DisplayName -Initials $_.MiddleInitial -SurName $_.Surname -Description $_.Description
    -Department $_.Department -StreetAddress $_.StreetAddress -City $_.City -State $_.State -PostalCode $_.ZipCode -
    HomePhone $_.TelephoneNumber -Title $_.Occupation -Office $_.Office -Path $_.Path -AccountPassword (ConvertTo-
    SecureString $_.Password -AsPlainText -force) -Enabled $True -PasswordNeverExpires $True -PassThru }




Industries

Broadcast
Corporate
Education
Event Centers
Healthcare
Home Theater
Hospitality
House of Worship
Museums
Residential
Retail


Solutions

Computer
Automation
Web
Phone

Explore

Accolades
Testimonials
Automation Portfolio
Web Portfolio
Design Portfolio

About

Company Info
Staff
Corporate Partnership
News & Events

Contact

TkFast, Inc.
437 South Hydraulic Street
Wichita, KS 67211-1911

Phone: 316-260-2500
Toll Free: 877-TKFAST-1
Fax: 316-260-4242

info@tkfast.com




©2024 TkFast, Inc. All Rights Reserved.  |  Privacy Statement  |  Site Map