#87023 - 2002-08-22 06:51 PM
Re: ADSI Create User with Kixtart...
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Your DN is incorrect.
Users is a container not an OU.
code:
$adsDomain = GetObject("LDAP://YourDomainNameHere/cn=administrator,CN=users,dc=qeh-tr,dc=sthames,dc=nhs,dc=uk")
|
Top
|
|
|
|
#87025 - 2002-08-23 01:30 PM
Re: ADSI Create User with Kixtart...
|
Richie19Rich77
Seasoned Scripter
   
Registered: 2002-08-16
Posts: 624
Loc: London, England
|
Yippppppeee, I have now got my script working.
I done the ting that no one likes doing, read up on the Microsoft Web site. lol
Here is my starter script that I can now muck around with.
Thanks for all your help. code:
$username = lisa.battman
$adsDomain = GetObject("LDAP://OU=Testing,DC=qeh-tr,DC=sthames,DC=nhs,DC=uk")
$adsUser = $adsDomain.Create("user","cn="+$username) $adsUser.Put("sAMAccountName", $username) $adsUser.SetInfo
$adsUser.LastName = "Battman" $adsUser.FirstName = "Lisa" $adsUser.SetInfo $adsUser.SetPassword "aa123456" $adsUser.AccountDisabled = False $adsUser.SetInfo
Richard Farthing
|
Top
|
|
|
|
#87026 - 2002-08-23 02:25 PM
Re: ADSI Create User with Kixtart...
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
You only need to use SetInfo one time after you adjust the properties.
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 323 anonymous users online.
|
|
|