header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

We have a new sponsor!  Introducting Pragma Systems.  See the home page for details.

ADLDS - Import CSV File and populate with new-QASUser
Last Post 19 Feb 2010 12:20 AM by Fulgore. 0 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
FulgoreUser is Offline
New Member
New Member
Posts:1
Avatar

--
19 Feb 2010 12:20 AM  
Hello,

I have to import values in a CVS File in AD LDS.

Here is my .csv sample file:

#TYPE Selected.Quest.ActiveRoles.ArsPowerShellSnapIn.Data.ArsUserObject
"Name","mail","StreetAddress","street","DN","Company"
"toto",,"3, maining street","miami","CN=toto,OU=Users,DC=XYZ,DC=local","toto Company"
"michel",,"JO street","Vancouver","CN=michel,OU=Users,DC=XYZ,DC=local","Michel Company"

here is my Powershell code:

#Variables
$SourceServer = "192.168.0.2:50000"
$PathCSV = "test2.csv"
$OU = "OU=Users,DC=XYZ,DC=local"
#---
connect-QADService -service $SourceServer

Import-Csv $PathCSV | where {new-QADUser -ParentContainer $OU  -name $_.name -Email $_.mail}

I have not shown all the attributes used for this example (-StreetAddress $_.StreetAddress ......)
Ok, this code import values correctly, but i have the attributes that may change in the CSV source File...and i  wonder if it's possible to not add all the parameters in new-QADUser => for example -City $_.city -Fax $_.fax .......

So, i tried to use  the -Import parameter ( new-QADUser -ParentContainer $OU -Import), but this don't works...

Have you any ideas to import a full CSV file without indicate some new-QADUser parameters (which correspond to the user attributes) ?

Second Question, can you help me to write some code which import Users in their Company OU, and previously create the Company OU  if it do not exist basing the CSV File

Regards,

FulG


You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 footer
footer