Page 1 of 1 1
Topic Options
#125150 - 2004-08-17 01:02 PM Extracting userid from a specified 'OU'
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Hello Kixtarters!

I need kix to help me extract the userid + username from a specified 'OU' active directory. Can anybody help with this?

Regards

Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#125151 - 2004-08-17 01:10 PM Re: Extracting userid from a specified 'OU'
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Ive previously used a script that allows me to read all of my useid/username info.
Code:
 $DomainName="RMNETNT"
$domain = GetObject("WinNT://$DomainName,domain")
? "GetObject: @error @serror"
$domain.filter = "user",""
? "Set Filter: @error @serror"
for each $user in $domain
? $user.name
? "Print name: @error @serror"
next

_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#125152 - 2004-08-17 02:53 PM Re: Extracting userid from a specified 'OU'
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I think you would need to use the LDAP provider.
$users = GetObject("LDAP://ou=Users,ou=yada,ou=bla,dc=mydomain,dc=local")
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#125153 - 2004-08-17 03:44 PM Re: Extracting userid from a specified 'OU'
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England

Thanks for replying
I know that there is a post about this some wheres, but after redirecting the output to a text file, it appends my usernames with zeros, how can I stop kix from doing this?

Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#125154 - 2004-08-17 03:56 PM Re: Extracting userid from a specified 'OU'
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You mean this FAQ?
Why does the console display zeros and ones (amongst others)?

You may want to look at these two as well:
File Input/Output Primer
Is '?' a PRINT or NEWLINE command?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


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

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.151 seconds in which 0.123 seconds were spent on a total of 12 queries. Zlib compression enabled.

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