Page 1 of 1 1
Topic Options
#85377 - 2002-03-21 05:45 PM Checking for locked accounts on NT Domain via ADSI ?
einhirn Offline
Fresh Scripter

Registered: 2002-03-20
Posts: 12
Hello.
I am trying to check for Locked (disabled?) User Accounts on my WinNT-Domain.
By now I do that with this code:
------------------
$pcpool = GetObject("WinNT://PC_POOL") ;Connect to domain
IF NOT $pcpool = 0 ;Confirm connection

for each $user in $pcpool
if $user.class="User"
if $user.isaccountlocked = true
$locked="L "
else
$locked=" "
endif
? $user.name " "+ $locked
endif
next

else
? @ERROR
?
? @SERROR
ENDIF
----------------------

But all I get is an L for ever listed user. Seems strange to me. Can anyone help?
bye
Einhirn
_________________________
SIGSIG: No Signature found

Top
#85378 - 2002-03-21 05:49 PM Re: Checking for locked accounts on NT Domain via ADSI ?
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
change -> ? $user.name " "+ $locked
to -> ? $user.name + " " + $locked

[ 21 March 2002, 17:49: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85379 - 2002-03-21 05:57 PM Re: Checking for locked accounts on NT Domain via ADSI ?
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I also think you want to change: if $user.isaccountlocked = true

to: if $user.isaccountlocked <> 0
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85380 - 2002-03-21 06:33 PM Re: Checking for locked accounts on NT Domain via ADSI ?
einhirn Offline
Fresh Scripter

Registered: 2002-03-20
Posts: 12
By now I found my real error:
The accounts weren't locked but disabled. Coding is difficult if your System is German and Function names are "Speaking" English...
----------
if $user.accountdisabled <> 0
----------
_________________________
SIGSIG: No Signature found

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2312 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.057 seconds in which 0.027 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