How to import single value .csv into multi value custom attribute?


hello,

i need import single value attribute .csv (just number, ex. 5457543), „custom“ multi value attribute

(ex. myfield1)

this line;  import-csv .\import.csv | foreach-object {set-adcomputer -identity $_.name -myfield1 $_.myfield1} , error ;

set-adcomputer : parameter cannot found matches parameter name ' myfield1 '.

at line:1 char:76

+ import-csv .\import.csv | foreach-object {set-adcomputer -identity $_.name -myfi ...

+                                                                            ~~~~~

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

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

 

set-adcomputer : parameter cannot found matches parameter name ' myfield1 '.

at line:1 char:76

+ import-csv .\import.csv | foreach-object {set-adcomputer -identity $_.name -myfi ...

+                                                                            ~~~~~

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

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

i think needs type of array, can't figure out, help?

thursday, august 11, 2016 7:41 am

i have found solution problem, fills category...

import-csv .\test.csv | %{set-adcomputer -identity $_.name -add @{myfield1=$_.myfield1}}

when have "name" , customfieldattribute custom added schema admin.

if there more cleaner way it, don't hesitate put example.

best regards.



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

0x300000d errors in Microsoft Remote Desktop client