header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
ADLDS - Import CSV File and populate with new-QASUser
Last Post 18 Feb 2010 04:20 PM 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

--
18 Feb 2010 04:20 PM
    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.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer