Login | |
|
 |
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
|
|
| |
|
|
|
|
|