Page 3 of 3 <123
Topic Options
#87023 - 2002-08-22 06:51 PM Re: ADSI Create User with Kixtart...
Howard Bullock Offline
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")  

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#87024 - 2002-08-22 09:52 PM Re: ADSI Create User with Kixtart...
Richie19Rich77 Offline
Seasoned Scripter
*****

Registered: 2002-08-16
Posts: 624
Loc: London, England
Hi

I am now at home so can't test on my server at work, but can I do some kind of testing of this script on my Windows 2000 Pro PC at home.

Can I connect into my AD running on my win200 pro client, and just test some scripts.

Thanks

Richie

Top
#87025 - 2002-08-23 01:30 PM Re: ADSI Create User with Kixtart...
Richie19Rich77 Offline
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 Offline
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.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 3 of 3 <123


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 323 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.052 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org