Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

updating multiple fields, set-ADUser, missing an argument

$
0
0

It's late and I'm probably not seeing something obvious. 

Trying to run this script for updating multiple AD fields on a list of users.

Would anyone be interested in giving a lesson on what I should be doing correctly?

Thanks

$data = import-csv C:\2.csv

import-module activedirectory
foreach ($d in $data)
{

$sam = $d.sAMAccountName

$street = $d.streetAddress

$city = $d.l

$state = $d.st

$zip = $d.postalCode

$co = $d.co

$tele = $d.telephoneNumber

$title = $d.title

$comp = $d.company

(Set-ADUser $street -StreetAddress $city -City $state -State $zip -PostalCode $co -Country $tele -OfficePhone $title -Title $comp -Company )
}


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>