PowerShell for Windows Admins:

January, 2014

A question came up on the forum regarding when Windows Update last run and when an update was last installed. Get-Hotfix shows the date of installation for most BUT not all patches.
The registry holds values showing last successful detection and install:
$props = [ordered]@{ LastDetect =...

The Win32_ComputerOperatingSystem class can provide a good deal of information about the OS installed on your machines. These examples are converted from those presented here: http://msdn.microsoft.com/en-us/library/aa394596%28v=vs.85%29.aspx
# ServicePack version
Get-CimInstance -ClassName...

You can see the running processes on a local or remote machine using Get-Process. Alternatively you can use Win32_Process:
Get-CimInstance -ClassName Win32_Process | select Name, ProcessID, Threadcount, PageFileUsage, PageFaults, WorkingSetSize | Format-Table –AutoSize
You can use the...

To see the command lines that have been used when processes are started is simple one liner:
Get-CimInstance -ClassName Win32_Process | select Name, CommandLine
If you want to investigate specific processes use the –Filter parameter to restrict the processes

This one is interesting as I’d tried doing this a while back and failed. Starting a process with Win32_Process is straightforward but controlling the process – such as starting in a hidden window wasn’t working. This is how you do it:
function start-hiddenproc...

Back in the day when all we had was VBScript you could run scripts through the command line (cscript) or you would get a more graphical interface (wscript). One of the examples at 0 CommentsRSS FeedEmail a friend

I’ve written unfavourably on the Kindle app in the past but I stumbled on an piece of functionality in the app that makes me take a lot of my comments back – search.
If you are in the Kindle app and bring up the charms you can get into search. This means you can search for books within your...

About This Blog

A blog for Windows administrators, Architects, Consultants and System Integrators maximizing the use of PowerShell and WMI. Simple solutions to everyday problems using two tools that should be available on every Windows system. Save time, save effort, script now!