Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Account Logout or User Login Attempts

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,51022
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Account Logout or User Login Attempts
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Account Logout or User Login Attempts - 8/21/2007 6:14:01 PM   
  yihwen

 

Posts: 2
Score: 0
Joined: 11/15/2005
Status: offline
Hi

I wondering if anyone have any scripts out there to generate a list of account lockout users and send an email to the administrator every 10 mins should there be anyone with account locked out?

Is there a way to use VBS to email an alert when a failure attempt to login for any user account? This will be useful so that I will know who is trying to be funny.

Thanks
Yih Wen
 
 
Post #: 1
 
 RE: Account Logout or User Login Attempts - 8/21/2007 9:26:56 PM   
  SAPIENScripter


Posts: 276
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
You should be able to use something like this.


      

You need to modify it to list every user in the domain. There are also plenty of examples showing you how to use CDO to send an email. 

But from a practical perspective you have some challenges.  First, you would need a script that is constantly running, checking Active Direcory every 10-15 minutes.  And if a user is locked out, won't they be calling for help anyway?  Or do you have a joker or two who is purposely attempting bad logons with other peoples credentials to lock them out? In which case you have a real management and end-user policy issue. You won't be able to tell who is abusing the system.  Even if you figure out which computer the logon attempts are taking place you still can't know who, unless you have cameras or something.

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

Follow Me: http://www.twitter.com/JeffHicks

(in reply to yihwen)
 
 
Post #: 2
 
 RE: Account Logout or User Login Attempts - 8/22/2007 6:32:45 PM   
  yihwen

 

Posts: 2
Score: 0
Joined: 11/15/2005
Status: offline
Hi

Thanks for the reply, I can set a scheduled task to run for every 10 mins. Our AD is the main authentication to many services and sometimes user reported issue that they cannot login to that services. In order to streamline our troubleshooting, we will know that should the user report they cannot access certain services, we know that his account is lockout due to the 10 min interval check. The script that you sent seem to check only a single user. I would hope to be able to check thru the entire domain and send email when detected that the account is lockout.

Thanks
Yih Wen

(in reply to SAPIENScripter)
 
 
Post #: 3
 
 RE: Account Logout or User Login Attempts - 8/22/2007 11:34:12 PM   
  SAPIENScripter


Posts: 276
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
You need to modify the code to get every user.  I'd take the code I pasted earlier and turn it into a function.  Have the function return True or False.

set wshNetwork=CreateObject("wscript.network")
set objDomain=GetObject("WinNT://" & wshNetwork.UserDomain)
objDomain.Filter=array("user")
For each member in objDomain
if IsAccountLocked(member.name) then
   wscript.echo member.name & " is locked"
end if
next

Function IsAccountLocked(strUserName)

'use my other code here. You'll need to modify it to take a username as a parameter.


end function

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

Follow Me: http://www.twitter.com/JeffHicks

(in reply to yihwen)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Account Logout or User Login Attempts Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts