Bulk edit AD Users Employee ID and EmployeeType from CSV with email addresses


hi,

im trying edit bulk of users have email in csv. attrib need updated employeeid , employeetype.

import-module activedirectory $users = import-csv c:\temp\updateusers.csv foreach ($user in $users) { get-aduser -filter "emailaddress -eq '$($user.emailaddress)'" | set-aduser -employeeid $($user.employeeid) -employeetype $($user.employeetype) }

my csv file looks this

emailaddress;employeeid;employeetype
user1@company.local;12345678;typea

but recieve error

set-aduser : parameter cannot found matches parameter name 'employeetype'.

at c:\users\untitled1.ps1:5 char:44

+ set-aduser -employeeid $($user.employeeid) -employeetype $($user.employeetype)

+                                            ~~~~~~~~~~~~~

    + categoryinfo          : invalidargument: (:) [set-aduser], parameterbindingexception

    + fullyqualifiederrorid : namedparameternotfound,microsoft.activedirectory.management.commands.setaduser

any tips?


the error pretty clear. there no "employeetype". 

what happens when try this

get-aduser "$env:username" -properties * | select-object employ*

do type?


grüße - best regards

ps:> (79,108,97,102|%{[char]$_})-join''



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Azure MFA with Azure AD and RDS

Failed to setup initiator portal. Error status is given in the dump data.

Invalid pointer on gpresult /h gpreport.html