Scan Cluster Volume Health

I created this function some time ago already when we did not have the SCOM Management Pack for Windows Clusters imported yet.

This script basically scans a Cluster, to scan its current CSV State, and report you the current size/usage/freespace available.

The output of this script can be used to filter out unhealthy volumes, or volumes that are filling up!

 

Make a SSH Connection using Powershell

Ever needed to connect to a hardware or unix interface from a windows box? For example to manage HP Servers / Interfaces, or to run some code on a Linux appliance?

Over at Powershelladmin.com they have an answer to this: SSH-Sessions powershell module.

Copy the SSH-Sessions folder to your C:\Windows\System32\WindowsPowerShell\v1.0\Modules directory and then unblock the SSH.Net library using Unblock-File C:\Windows\System32\WindowsPowerShell\v1.0\Modules\SSH-Sessions\Renci.SshNet.dll

After that you can just Import-module the SSH-Sessions and you’re on your way:

Has your hotfix been installed?

Of course you may wonder, why do you not use SCCM or WSUS to check if your software was installed successfully. Sadly when working in an enterprise environment you do not always have access to all the tooling you require, even though you have administrator access to the servers you need to manage.

Recently I was asked if I could scan all our Hypervisors to see if the latest December update rollup was installed, and if possible to mail it to the team’s functional mailbox.

This resulted in the following simple script:

Now you only need to add your results to an email message using “send-MailMessage”

SCOM Maintenance Mode

Have you ever had the hassle of needing to put multiple servers into SCOM maintenance mode, yet you dont have the Powershell commandlets installed, or you are using an older version of SCOM that just does not do what you would like it to do.

I ran into the same issue with a customer, that was using SCOM 2007R2, while at some days it would really come in handly to place servers into maintenance mode scripted.

The script below can be your answer to this problem. Simply use the function SCOMMaintenanceMode -servername “server” -maintenancemodeminutes “minutes” or even push an array of servers against it. It will first check if maintenance mode is already set and if the current duration is not longer then what you just told the script.