SCOM: Command Channel Script


This little script is what I use in cooperation with the SCOM Command Channel to parse and send SCOM alerts to a logfile. The script will take the SCOM alert parameters and put them neatly in a .log file, one file for each alert I want. This, of course, is customizable – I just like…

Read More

Request Template Certificates using CertReq and Powershell


Installing SCOM agents on non-domain servers can be a real time-consuming affair, especially the Create template-request-export-import-certificates procedure. I decided to use my basic certificate and CertReq knowlegde to create this little script that helps me automate the whole thing. NOTE: This is meant for inspiration only. If will for the most part not work in…

Read More

Get MSMQ (Message Queuing) queues with Powershell


Simple, yet effective. Especially if you don’t have the MSMQ module for PS. $queues = Get-WmiObject -computername “YourServer” Win32_PerfFormattedData_msmq_MSMQQueue $queues | ft -AutoSize -property Name,MessagesInQueue – F

Read More

Query MSSQL with Powershell


I often use different variety of this snippet to do stuff with MSSQL databases (and other types as well, with minor changes to the script). The script will use SQL Auth by default. To change this to Windows Auth, change the Connection String to: $SqlConnection.ConnectionString = “Server = $SQLServer; Database = $SQLDBname; Integrated Security =…

Read More

Test webservices with Powershell


I use this little thing to test webservices (by invoking SOAP/GET request etc) whenever I want to parse the output to, say, Windows Event Logs, or the nearest SoapUI installation is far far away. The $request.SetRequestHeader parameters may vary from situation to situation, but in most cases this code should be sufficient for simple Webservices….

Read More

SCOM Agent install fails – Returncode 1603


My entire OpsMgr environment runs SCOM 2012 R2 UR1. Occationally I come across Windows Servers that dont have any Agents installed – or so it seems. A couple of days ago, this happened. I came across three servers without an agent, and started the Discorvery wizard. All servers was discovered successfully, and I stared to…

Read More

Powershell Unrar script v2.0!


This one is a little more andvanced, as it “cleans up” after itself by deleting the .rar parent folder after successfully extracting it. Of course, use this at your own risk. It tends to be a little ruthless, considering there’s no going back as soon as the parent folder is deleted. In other news: IT’S…

Read More

List Windows Server OS


I always forget the correct line for listing these things with WMI. Therefore, it’s now perpetuated on Fuffle.net. =) cls $servers = get-content “C:tempserverlist.txt” foreach ($s in $servers){ $gwmi = (Get-WmiObject -ComputerName $s -class win32_operatingsystem -ErrorAction SilentlyContinue).caption write-host “$s – IP:”([System.Net.Dns]::GetHostAddresses($s)) – $gwmi -foregroundcolor “green”} -F

Read More

Powershell Ping


This neat little thing wil test connection for a list of pingable DNS names (URLS, switches, servers, computers, whatever), and output the result in a list with the objects IP address(es). If the ICMP ping does not reach the object, it outputs this and jumps to the next object on its list. Hurray! cls $servers…

Read More

Output displayname and IP address for SCOMagents


Got bored – wrote this little thing to output FQDN and IPaddress for all Windows and UnixLinux agents in my lab environment. Could be useful for some people maybe.   ipmo operationsmanager $nixservers = get-scomclass -name “Microsoft.Unix.Computer” | Get-SCOMMonitoringObject $winservers = Get-SCOMClass -name “Microsoft.Windows.Computer” | Get-SCOMMonitoringObject Write-host “—————————————————————–” write-host “——————– Unix Computers and IPs ———————“…

Read More

← OLDER POSTS NEWER POSTS →