Manage AD Thumbnail photos

At a customer site recently, I came across some remnants of a Lync trial where users had thumbnail photos attached to their AD accounts. Trouble was, some of them were wrong, some were missing and some needed to be removed. Now there are plenty of tools out there to manage images, but I wanted to …

Read more

WSUS Reset and Re-Authorize

Recently I came across  a customer site where a lot of the machines had stopped receiving updates from WSUS, despite being visible in the WSUS console and having shown as reported in. I decided to write a powershell script to parse all the machines in AD, stop the Windows Update service, delete the SoftwareDistribution folder, …

Read more

Windows Password Roll Script GUI

Back in may 2014, Microsoft released a patch to fix a vulnerability in Group Policy Preferences which left many people without a method for changing local account passwords. Happily, they also provided a powershell script to allow sys admins to do this. Whilst the script works, it isn’t very elegant or user friendly, indeed one of …

Read more

How to unzip files in powershell

function Expand-ZIPFile($file, $destination) { $shell = new-object -com shell.application $zip = $shell.NameSpace($file) foreach($item in $zip.items()) { $shell.Namespace($destination).copyhere($item,16) #16 answers Y to any prompts, eg overwrite } } #call the function so: Expand-ZIPFile -file “c:\” -destination “d:\somedestination”  

Displaying Network Adapter Speed with WMI via the Win32 NetworkAdapter class

Quick little script to do the above.. Function GetNetworkSpeed(strComputer) Dim colItems, objItem, address Dim StrQuery Dim objWMIService StrQuery = “SELECT * FROM Win32_NetworkAdapter” Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\CIMV2″) Set colItems = objWMIService.ExecQuery(strQuery,,48) For Each objItem in colItems GetNetworkSpeed = GetNetworkSpeed & vbTab & objItem.ProductName & vbCr Next End Function   Or do …

Read more