#180769 - 2007-09-21 05:31 PM
Create User Account
|
danilda
Fresh Scripter
Registered: 2006-03-01
Posts: 21
Loc: Washington, DC
|
First off, let me say, I haven't the foggiest idea what I am doing. I need to create user accounts in AD. Borrowed some lines of code from other posting, but can't figure out where I am going wrong. Can someone please help me from my misery?
Thanks.
Code:
dim $domain, $user, $userName, $fullusername, $userdescription $username = "jdoe" $fullusername = "Jane Doe" $userdescription = "test
$Domain = GetObject("LDAP://cn=Users,dc=something,dc=com") $user = $Domain.Create("user", "ou=" + $userName) $user.Put("FullName", $FulluserName) $user.Put("Description", $userDescription) ;$user.SetInfo
$domain = 0 $user = 0
|
Top
|
|
|
|
#180918 - 2007-09-27 08:05 PM
Re: Create User Account
[Re: therob]
|
danilda
Fresh Scripter
Registered: 2006-03-01
Posts: 21
Loc: Washington, DC
|
Keep getting:
Error: Unknown command [LDAP:]
|
Top
|
|
|
|
#180919 - 2007-09-27 08:10 PM
Re: Create User Account
[Re: danilda]
|
danilda
Fresh Scripter
Registered: 2006-03-01
Posts: 21
Loc: Washington, DC
|
Found the problem, missing " on line above.
|
Top
|
|
|
|
#180963 - 2007-09-28 03:28 PM
Re: Create User Account
[Re: Mart]
|
danilda
Fresh Scripter
Registered: 2006-03-01
Posts: 21
Loc: Washington, DC
|
Having a hard time finding the attributes that I need to create user account. Need the following attribute: Enable Account. Also, can I place users in groups by using memberof attribute? Does anyone know where I can get a complete of attributes that will work with kix and LDAP?
thanks -- dee
Edited by danilda (2007-09-28 03:39 PM)
|
Top
|
|
|
|
#181167 - 2007-10-05 05:17 PM
Re: Create User Account
[Re: danilda]
|
therob
Starting to like KiXtart
Registered: 2005-05-19
Posts: 150
Loc: Frankfurt/M., Germany
|
Need the following attribute: Enable Account. i already wrote that above. Did you read my post at all? :|
$user.AccountDisabled = 0
$user.SetInfo
Also, can I place users in groups by using memberof attribute? No, but this can:
Function addtogroup ($adloginname,$adgroupname)
$grouppath = "LDAP://cn="+$adgroupname+",ou=OuLocationOftheGroup,dc=domain,dc=com"
$userpath = "LDAP://cn="+$adloginname+",ou=OuLocationoftheUser,dc=domain,dc=com"
$GroupObj = GetObject($grouppath)
$UserObj = GetObject($userpath)
$GroupObj.add ($UserObj.ADsPath)
$GroupObj.SetInfo
EndFunction
_________________________
Eternity is a long time, especially towards the end. - W.Allan
|
Top
|
|
|
|
#182014 - 2007-10-27 03:43 PM
Re: Create User Account
[Re: therob]
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 507 anonymous users online.
|
|
|