Announcement

Collapse
No announcement yet.

Script AD email address email

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script AD email address email

    Hello
    I have an Excel file that contains a list of users
    File has two columns
    1.User logon name
    2.Email
    For example :


    User logon name Email
    00000000001 [email protected]
    00000000002 [email protected]
    00000000003 [email protected]


    I need a script to come over 00000000001 user in AD and put his email address [email protected] and so the rest of the list
    I would appreciate your help

  • #2
    If you are familiar with Powershell (I'm not, I've only just started learning it), this may help:
    https://blogs.technet.microsoft.com/...ive-directory/
    A recent poll suggests that 6 out of 7 dwarfs are not happy

    Comment


    • #3
      What version Windows are your Domain Controllers running?

      I would save the Excel file as a CSV and then you could do something like this with Powershell:

      Code:
      $CSVFile = Import-CSV C:\userlist.csv #Change this to the name of the CSV file you saved from Excel
      Foreach($user in $CSVFile){
          Set-ADUser $User."User logon name" -EmailAddress $User.Email
      }
      This loops through the CSV file. $User."User logon name" and $User.Email references the respective column names for the row it's on in the loop. So if you change the name of the column in your CSV file, be sure to change it in the script as well.
      Regards,
      Jeremy

      Network Consultant/Engineer
      Baltimore - Washington area and beyond
      www.gma-cpa.com

      Comment

      Working...
      X