Category: PowerShell

  • Touching a file using Windows PowerShell

    Its been a little while since I’ve posted on my blog…it’s been a very hectic few months but I’m back and hopefully will be able to provide you guys with some more useful SCOM related things. Today though its Windows PowerShell as I was required to perform the equivalent of touching a file on a […]

  • Finding files with parenthesis in the name using Windows Explorer Search (and PowerShell)

    Today I had a friend message me and ask how he can find all files that have the text (1) or (2) or (3) in the file name using Windows Explorer as he wanted to delete them. First up I must admit to thinking it was a silly question, after all…just type it into the […]

  • Moving a computer object to an AD Group without using the AD Provider

    Today I had a colleague that needed to move a computer object to a group but he only had access to an older version of PowerShell and couldn’t load the AD Provider. Here’s what we came up with.

  • Querying AD for Computers that do not have a SCOM Agent

    Today I was having a chat about SCOM Agents with a couple of colleagues and the subject turned to finding out if every server that is in AD actually has an agent installed. I’m certain there are people out there that have their own solution but I thought why not just query AD for the […]

  • Changing Desktop Wallpaper using Windows PowerShell

    Today I was asked ‘how can I change my desktop wallpaper using Windows PowerShell? Actually the truth is, I was asked if there was any way of changing the wallpaper based on the resolution of the display. So if the computer was running a 1440×900 desktop then show a small wallpaper…if it was running 1920×1200 […]

  • Listing your IE Favorites (with URL) with Windows PowerShell

    Today I wanted to extract a list of each IE Favorite I’ve saved, along with the actual URL that it points to. Turns out it’s pretty easy. Here’s that code.   gci -path ([Environment]::GetFolderPath(“Favorites”)) -recurse | ? {$_.Length} | % {$_.BaseName; Get-Content $_.FullName -ea silentlycontinue | Select-String ^url=*| %{$_ -replace “^url=”,”” ;””}}   The output […]

  • Triggering a Runbook from a SCOM Alert/Recovery

    In previous posts I talked about how you can get a list of Runbooks from your Orchestrator Server and how you can use PowerShell to trigger a Runbook by supplying only the name of a Runbook and not a GUID. Today we’re going to see how we can get SCOM to trigger a Runbook as a […]

  • Using PowerShell to run an Orchestrator Runbook by Name

    I’ve seen a lot of posts on the Internet describing how you can use Orchestrator to trigger a Runbook when a condition is met. For example, Orchestrator can poll SCOM for a specific event and when it occurs it can trigger a Runbook . But what about when you want to trigger a Runbook from […]

  • Listing your Orchestrator Runbooks using PowerShell

    As part of a bigger post on Runbooks, I needed to find a way of listing the names of my Orchestrator Runbooks using PowerShell. This script will output the name and the ID of each Runbook.