Tag: PowerShell

16th November 2014 · Luca Sturlese
Important Update

As of September 2015, I have released version 2 of my PowerCLI 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!

Version 2 of the template is available here – PowerCLI Script Template v2.


A while a go I posted up my PowerShell Script Template which turned out to be pretty popular with fellow PowerShellers.

I recently create another slightly modified template when working with PowerCLI, so I thought I would share it here. Here is my PowerCLI Script Template to be used for all your VMware scripts…

Read More “PowerCLI Script Template”

18th September 2014 · Luca Sturlese

This is a quick article on how to send an email with PowerShell. The way I have done this is that I have created a Send-Email PowerShell function which can then be added to your function library and dot sourced in your PowerShell scripts.

Alternatively you could just copy paste this function directly into your script and call it from there. Either way, it is simple and it works. Plus you can send both plain-text and HTML emails. So here it is…

Read More “How To – Send an email with PowerShell”

24th March 2014 · Luca Sturlese

Hi All,

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….

Read More “PowerShell Encryption Function Library”

19th February 2013 · Luca Sturlese
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!

Version 2 of the template is available here – PowerShell Script Template v2.


Recently I put up an article on how to easily create log files in PowerShell. If you want to read that post, then check out this link – PowerShell: How to easily create log files for your scripts.

Today’s article is the next step in the process of creating awesome PowerShell scripts.

Read More “PowerShell Script Template”

19th February 2013 · Luca Sturlese
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.

Read More “PowerShell: How to easily create log files for your scripts”

7th August 2012 · Luca Sturlese

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.

Read More “Use Get-WinEvent to find account lockout events”