Hi all.
i have a little problem and i am a newbee in powershell
i have a csv with the column “sAMAccountName” and the Column “extensionAttribute15”
with this file i want to get the users from the csv and set the informations from Column “Batch” to the extensionAttribute15.
sAMAccountName Batch
User1 160576
Hier my script.
$attribute = Import-Csv -path “C:\Temp\AttibuteUniflow.csv” -Delimiter “;”
Foreach ($user in $attribute)
{
get-aduser $attribute.sAMAccountName | Set-ADUser - $attribute.Batch -add @{extensionAttribute15 = $attribute.Batch}
}
The error i get:
Set-ADUser : A positional parameter cannot be found that accepts argument ‘160576’.
At C:\Temp\uniflow.ps1:6 char:40
- … countName | Set-ADUser - $attribute.Batch -add @{extensionAttribute …
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidArgument: (
[Set-ADUser], ParameterBindingE
xception - FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.ActiveDirector
y.Management.Commands.SetADUser
- CategoryInfo : InvalidArgument: (
Many thanks for your Help