Page 2 of 2 <12
Topic Options
#193259 - 2009-03-30 08:23 PM Re: User Account Locked Notification [Re: JeffS]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, this won't work:
 Code:
$LStat = $objUser.IsAccountLocked

If $LStat = TRUE


as it actually says something like this on locked accounts:
 Code:
if -1 = 0
_________________________
!

download KiXnet

Top
#193260 - 2009-03-30 08:29 PM Re: User Account Locked Notification [Re: Lonkero]
JeffS Offline
Fresh Scripter

Registered: 2007-01-17
Posts: 29
Loc: Portland, OR
I thought AD reports a Locked Out status as a Boolean. So either TRUE or FALSE?

Or am I missing the boat here. Actually I bet I am missing the boat! :-)

Top
#193263 - 2009-03-30 08:42 PM Re: User Account Locked Notification [Re: JeffS]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Notice the original example
 Code:
  If $LStat  
It doesn't compare it to anything, just tests to see if it's true (non-zero). The
 Code:
If $LStat = TRUE
really should not have the "= TRUE" part, but it does work because "TRUE" evaluates to non-zero. Not a good way to implement, I agree, but it does work.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#193264 - 2009-03-30 09:04 PM Re: User Account Locked Notification [Re: Glenn Barnas]
JeffS Offline
Fresh Scripter

Registered: 2007-01-17
Posts: 29
Loc: Portland, OR
If I remove the "=TRUE" part, the list come back blank. Even if there are locked accounts, so I figured I needed some type of qualifier.
Top
#193265 - 2009-03-30 09:12 PM Re: User Account Locked Notification [Re: JeffS]
JeffS Offline
Fresh Scripter

Registered: 2007-01-17
Posts: 29
Loc: Portland, OR
Unless the issue is with the domain I am in I can't figure this out.

If I run the above script, it says that every account in the Domain is NOTLOCKED. However, if I lock out one of the accounts and replicate that information to all of the DC's in the domain, and I verify by using LockOutStatus.exe then rerun the report the username does not show up in the list and no accounts are shown as being locked out.

I am confused of why it is doing it, any suggestions?

Top
Page 2 of 2 <12


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

Who's Online
0 registered and 259 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.039 seconds in which 0.018 seconds were spent on a total of 15 queries. Zlib compression enabled.

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