Jump to content

Need Script Help


yawnb
 Share

Recommended Posts

I am working on a script that will lock a users PC after a password change through a VPN program. When a users password has expired the VPN program will prompt the user with a dialog box saying they must change their password. Below is my current script and it works somewhat. What I need to know is if the user clicked OK or Cancel on the password change dialog. After the program connects it automatically minimizes to the tray, I also need to know when it does that. Are their functions that I can use that will accomplish this? Is there a better way to write this script to accomplish this? Thanks in advance.

CODE
AutoItSetOption("WinTitleMatchMode", 2)

Dim $wasPrompted

WinWaitActive("User Authentication", "confirm1", 600) //Wait for password change box

//Need something here to know if user click OK or Cancel

$wasPrompted = True

WinWaitNotActive("User Authentication", "", 600)

//Need something here to catch when the program minimizes

if $wasPrompted Then

MsgBox(64, "Remote password change.", "You have changed your password remotely with the VPN client." & @CRLF & "Your machine will now be locked to complete the validation process." & @CRLF & "To unlock your PC use your new password.")

Run("rundll32.exe user32.dll,LockWorkStation", @SystemDir)

Else

MsgBox(64, "No prompt")

EndIf

Link to comment
Share on other sites

Why is everyone into locking their computers these days?

When a user changes their password remotely one way to update the cached credentials on their machine is to lock and unlock it with the new password.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...