About a year ago I had a requirement to securely store a few passwords that would then be used to run a PowerShell script. At the time, I thought it would be a good idea to create another one of my PowerShell Function Libraries, such as my PowerShell Logging Function Library.

This article documents my solution and the end product: PowerShell Encryption Function Library….

Important Update

As of September 2015, I have released version 2 of my PowerShell Script Template, which includes a number of improvements over this version, in particular the use of the new PSLogging PowerShell module that significantly improves the creation and management of log files. This version of the template is no longer supported or maintained, so please upgrade to the new version today!

Important Update

As of September 2015, I have released version 2 of my PowerShell Logging solution, and is now known as PSLogging.

There has been a number of significant improvements with the most notable being that the PowerShell Logging function library has now been converted into a fully fledged PowerShell module. All of the details about the new version, the improvements and how to use and integrate the new version into your new and existing scripts can be found here – PSLogging PowerShell module.

Note: This version of the logging solution is no longer supported or maintained, so please upgrade to the new version today!

Today I thought I would share some thing that I have developed over the last year or so as I have been working more and more with PowerShell…. some standard functions that can simply be dot sourced and called at any time so that all my scripts have some awesome logs to go along with the awesome script.

Over the past few months I have started using PowerShell as my primary scripting tool. Depending on what I am trying to achieve I sometimes like to have some form of GUI for my scripts, especially when user input is required.

Last week I had a user report that his account kept locking a number of time throughout the day. Usually this is because they haven’t logged out of a machine and then have changed their network password, so when that remote machine tries to authenticate… bang account lockout.

More often than not, the user has no idea what he is still logged into, so the only way is to solve this is to go through the Security event logs on each domain controller and find the account lockout event for that user. This will then tell you from what machine the account lockout took place. You can then get the user to log out and problem fixed.

Although this works, to be honest it’s manual process which really like most manual processes…it’s boring. So then I thought, why not create a PowerShell script that can easily do this for me.