The ConnectWise Control forum has moved to ConnectWise University! This forum has been locked and is in read-only mode. Click here for instructions on how to access the new forum.

Welcome Guest! You can not login or register.



Go to last post Go to first unread
Ben B  
#1 Posted : Tuesday, November 3, 2015 5:01:45 PM(UTC)
Ben B

Rank: Administration

Medals: Level 2: Lent a Helping Hand! 10 Thanks!

Joined: 10/2/2015(UTC)
Posts: 329

Thanks: 1 times
Was thanked: 71 time(s) in 63 post(s)
The lockedAccounts.ps1 Powershell script is designed to run on self-hosted Windows ScreenConnect servers.

You will need to unzip/open the attached script and substitute in your own file paths and credentials as indicated by [brackets].

You will also need to define a scheduled task in Task Scheduler that executes one of the following commands after some time interval has elapsed (e.g. every 5 minutes):

  • powershell.exe -ExecutionPolicy Bypass -Command "[path]\lockedAccounts.ps1" -o $true
  • powershell.exe -ExecutionPolicy Bypass -Command "[path]\lockedAccounts.ps1"

The first command will attempt to send emails using Outlook.
The second command will attempt to send emails via user-defined mail settings.

The script does the following:

  • makes a copy of App_Data\User.xml and moves the copy to a directory of your choosing
  • compares the current user state to the previous user state
  • if at least one user has been locked out of his or her account since the last check, the script sends an email alert

This script was developed using Powershell V4.

Disclaimer: This script was written by our support team (and in some cases in conjunction with our forum community) in response to customer requests. Scripts are meant to be quick workarounds or immediate solutions to problems. Scripts are not supported under our normal terms of service, as these scripts are outside typical Q/A or development guidelines. Questions for scripts should be addressed in its respective forum post. Suggestions for improvements (enhancements or defects) should also be queued in the post for consideration.
File Attachment(s):
LockedAccounts.zip (2kb) downloaded 104 time(s).
ScreenConnect Team

#2 Posted : Sunday, December 27, 2015 6:21:24 PM(UTC)

Rank: Advanced Member

Joined: 7/2/2013(UTC)
Posts: 30

Thanks: 4 times

Script is great, however, I'd like to know the IP of the locked account.
Could not find this in User.xml file.
Am I missing something or should I post a suggestion?

Thank you.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.