Comments are closed for this post.
Posted by
Scott Dukes
@
30 Jun 2008
2:18 AM
Or you could just use Quest's (free) AD cmdlets - which rock :-)
http://www.quest.com/powershell/activeroles-server.aspx
Posted by
BomBom
@
08 Jul 2008
3:29 AM
Do it like this:
$newUser.psbase.InvokeSet('AccountDisabled', $false)
$newUser.SetInfo()
Has to be done in the right order (create user, SetInfo, enable account, SetInfo)
Posted by
josh
@
27 Jan 2009
12:41 AM
Thanks BomBom - post updated!
Posted by
Naveed
@
22 Sep 2010
6:26 AM
Hi
Thanks for the code, can i define the custom users login ID using this code.
Naveed
Posted by
khaldun azar
@
13 Jul 2011
12:14 PM
please help i run a script as different way
$users = import-csv "C:\activedirectoryscript\users.csv"
$container = [ADSI] "LDAP://cn=companyOU,DC=bsa,DC=edu,DC=jo"
$users | foreach {
$UserName = $_.GivenName
$LastName = $_.Surname
$SamAccountName = $_.samAccountName
$DisplayName = $_.DisplayName
$UserPassword = $_.Password
}
i have a csv file entry like obove
GivenName,Surname,samAccountName,DisplayName
johan,azar,johan.azar,johan azar
sami,gagish,sami.gagish,sami gagish
it executied but no entry inside OU in AD.
please help
Posted by
Darryl
@
09 Aug 2011
5:42 AM
@khaldun azar
Josh is creating his users within the Built-in Users container, not an OU.
Try OU=, rather than CN=
$container = [ADSI] "LDAP://OU=companyOU,DC=bsa,DC=edu,DC=jo"
I think that's right, but I can't test it at the moment