Import users to AD

  • Follow


I am trying to import 200 users from a .csv file to Windows 2008 R2 Active 
Directory. As I have no idea of scripting, I searched the Internet and found 
this:
Import-CSV c:\users.csv | ForEach-Object { New-QADUser -Name $_.display 
-SamAccountName $_.SamAccountName -UserPrincipalName $_.user1 -FirstName 
$_.first -LastName $_.last -DisplayName $_.display -Phone $_.phone 
-Department $_.departamento -Title $_.Title -Company $_.company 
-Streetaddress $_.street -PostalCode $_.zip -City $_.city -StateOrProvince 
$_.state -UserPassword $_.password -ParentContainer DOMAIN.CORP/NEWUSERS }
But I get the error: "Power Shell does not recognize the cmdlet New-QADUser"
The .csv file contains only First Name, Last Name, UserPrincipalName and 
UserPassword fields.
Any help about correct syntaxis welcome 


0
Reply Utf 12/30/2009 5:06:01 AM

Francisco schrieb:
> I am trying to import 200 users from a .csv file to Windows 2008 R2 Active 
> Directory. As I have no idea of scripting, I searched the Internet and found 
> this:
> Import-CSV c:\users.csv | ForEach-Object { New-QADUser -Name $_.display 
> -SamAccountName $_.SamAccountName -UserPrincipalName $_.user1 -FirstName 
> $_.first -LastName $_.last -DisplayName $_.display -Phone $_.phone 
> -Department $_.departamento -Title $_.Title -Company $_.company 
> -Streetaddress $_.street -PostalCode $_.zip -City $_.city -StateOrProvince 
> $_.state -UserPassword $_.password -ParentContainer DOMAIN.CORP/NEWUSERS }
> But I get the error: "Power Shell does not recognize the cmdlet New-QADUser"
> The .csv file contains only First Name, Last Name, UserPrincipalName and 
> UserPassword fields.
> Any help about correct syntaxis welcome 
> 
> 

The New-QADUser Commandlet is not part of the standard edition of 
Powershell.

Check out the powergui website:

http://wiki.powergui.org/index.php/New-QADUser


Uwe
0
Reply Uwe 12/30/2009 5:40:03 AM

New-QADUser is part of the Quest AD cmdlets

for R2 replace it with New-ADUser.   Check ALL of the parameters against the 
help file because the some of the names are different
-- 
Richard Siddaway
All scripts are supplied "as is" and with no warranty 
PowerShell MVP
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"Uwe Ziegenhagen" wrote:

> Francisco schrieb:
> > I am trying to import 200 users from a .csv file to Windows 2008 R2 Active 
> > Directory. As I have no idea of scripting, I searched the Internet and found 
> > this:
> > Import-CSV c:\users.csv | ForEach-Object { New-QADUser -Name $_.display 
> > -SamAccountName $_.SamAccountName -UserPrincipalName $_.user1 -FirstName 
> > $_.first -LastName $_.last -DisplayName $_.display -Phone $_.phone 
> > -Department $_.departamento -Title $_.Title -Company $_.company 
> > -Streetaddress $_.street -PostalCode $_.zip -City $_.city -StateOrProvince 
> > $_.state -UserPassword $_.password -ParentContainer DOMAIN.CORP/NEWUSERS }
> > But I get the error: "Power Shell does not recognize the cmdlet New-QADUser"
> > The .csv file contains only First Name, Last Name, UserPrincipalName and 
> > UserPassword fields.
> > Any help about correct syntaxis welcome 
> > 
> > 
> 
> The New-QADUser Commandlet is not part of the standard edition of 
> Powershell.
> 
> Check out the powergui website:
> 
> http://wiki.powergui.org/index.php/New-QADUser
> 
> 
> Uwe
> .
> 
0
Reply Utf 1/6/2010 1:11:02 PM

2 Replies
1506 Views

(page loaded in 0.161 seconds)


Reply: