Hello,
i would like to import a .csv file to fill attributes in AD ( for example "ExtensioneAttribute2"); the import match the attribute "mail" for
I try with this two scripts, but without success:
1) Import-Csv c:\user\admin\desktop\test.csv | ForEach-Object {Get-ADUser -filter {mail -eq $.mail}|Set-ADUSer -extensionAttribute2 $.extensionAttribute2}
Set-ADUser : A parameter cannot be found that matches parameter name 'extensionAttribute2'.
At line:1 char:118
- ... ser -filter {mail -eq $.mail}|Set-ADUSer -extensionAttribute2 $.exten ...
- ~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidArgument: (:) [Set-ADUser], ParameterBindingException
- FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory.Management.Commands.SetADUser
Set-ADUser : A parameter cannot be found that matches parameter name 'extensionAttribute2'.
At line:1 char:118
- ... ser -filter {mail -eq $.mail}|Set-ADUSer -extensionAttribute2 $.exten ...
- ~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidArgument: (:) [Set-ADUser], ParameterBindingException
- FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory.Management.Commands.SetADUser
2) Import-Csv c:\users\chiappini_dlv\desktop\test.csv | ForEach-Object {Set-ADUser $.mail ` -ObjectAttributes @{ExtensionAttribute2=($.ExtensionAttribute2)}}
Set-ADUser : A parameter cannot be found that matches parameter name 'ObjectAttributes'.
At line:1 char:91
- ... .csv | ForEach-Object {Set-ADUser $_.mail ` -ObjectAttributes @{Exten ...
- ~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidArgument: (:) [Set-ADUser], ParameterBindingException
- FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory.Management.Commands.SetADUser
Set-ADUser : A parameter cannot be found that matches parameter name 'ObjectAttributes'.
At line:1 char:91
- ... .csv | ForEach-Object {Set-ADUser $_.mail ` -ObjectAttributes @{Exten ...
- ~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidArgument: (:) [Set-ADUser], ParameterBindingException
- FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory.Management.Commands.SetADUser