Update AD users

Welcome Forums General PowerShell Q&A Update AD users

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years ago.

  • Author
  • #6266

    Points: 0
    Rank: Member

    by nmuzic at 2013-01-30 06:19:39

    Could someone help me with updating users info in Active directory?
    I'm trying with following code:
    [code2=powershell]Import-Module ActiveDirectory
    $users = Import-Csv -Path c:\ADMIN\Users.csv -delimiter ";"
    foreach ($user in $users) {
    Set-ADUser -Identity $($user.SamAccountName) -Replace @{telephoneNumber = $($user.telephoneNumber); pager = $($user.Pager); ipPhone = $($user.ipPhone); facsimileTelephoneNumber = $($user.facsimileTelephoneNumber); mobile = $($user.mobile); physicalDeliveryOfficeName = $($user.physicalDeliveryOfficeName); department = $($user.department); description = $($user.description)}

    csv file contains user data in the format:
    jondoe;jon;doe;+xxxxxxxx;xxxx;+xxxxxxxxxxx;+xxxxxxxxxxx;;place;IT department;IT officer
    I have problem with users that have an empty value for example "mobile" and doesn't update any value for that user.


    by Tadziz at 2013-01-30 07:47:50

    I'm new in powershell but maybe this link can help you
    http://blogs.technet.com/b/heyscripting ... ctory.aspx

    if you need to update users from your computer i would open new-pssesion and when update user using ad cmdlet 🙂

The topic ‘Update AD users’ is closed to new replies.