+ Post New Thread
Page 3 of 3 FirstFirst 123
Results 31 to 31 of 31
Windows Thread, Bulk update of Active Directory user info in Technical; CSV into powershell is probably the best way these days? To Create: Code: Import-Csv c:\users.csv | ForEach { $Name = ...
  1. #31

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,804
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    CSV into powershell is probably the best way these days?


    To Create:

    Code:
    Import-Csv c:\users.csv | ForEach
    {
      $Name = $_.givenName + " " + $_.sn
      New-ADUser 
        -Name $Name `
        -sAMAccountName $_.sAMAccountName `
        -GivenName $_.givenName `
        -Surname $_.sn `
        -Initials $_.initials `
        -DisplayName $_.displayName `
        -Department $_.department `
        -AccountPassword $_.ctPassword `
        -Path $_.OU `
        -ChangePasswordAtLogon $true ` 
        -Enabled $true
    }
    To Update:

    Code:
    Import-Csv c:\users.csv | ForEach ($User in $Userscsv)
    {
      Set-ADUser $User.sAMAccountName 
        -Replace @{
              title =$user.'job title'; 
              company = $User.'business unit'; 
              department = $User.'home department'; 
              telephonenumber = $User.'work phone'; 
              mobile = $User.'work wireless' 
              }
    }
    Last edited by Geoff; 14th June 2013 at 04:09 PM.

  2. 3 Thanks to Geoff:

    Netman (14th June 2013), rgriffiths (18th June 2013), xenonive (25th June 2013)

SHARE:
+ Post New Thread
Page 3 of 3 FirstFirst 123

Similar Threads

  1. Active Directory - Single and Bulk User creation and FREE!!
    By siuko in forum How do you do....it?
    Replies: 39
    Last Post: 20th June 2012, 11:29 AM
  2. Active Directory-Script for Creating Bulk Users
    By calapso in forum How do you do....it?
    Replies: 8
    Last Post: 14th January 2009, 06:32 PM
  3. Replies: 26
    Last Post: 19th May 2008, 11:54 PM
  4. Update Active Directory with mySQL table data?
    By netadmin in forum Windows
    Replies: 8
    Last Post: 30th October 2007, 10:43 PM
  5. Replies: 3
    Last Post: 16th November 2006, 09:55 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •