Discover Recent ConfigMgr Software Metering Data on a Client

Here’s a quick post but a useful one. Today, I needed to get a quick idea of what ConfigMgr metering rule data a particular client had generated recently. I have my Software Metering Usage Report Cycle set to every 7 days so I knew I’d only find 7 days worth in there but it did the trick for me. Here’s how I found all instances output in an easy to understand format. This outputs the computer name, time the meter rule was triggered and the product name that was triggered.

Read more

Learn How to Use Powershell to Post to Campfire’s API

Myself and few of my coworkers use 37 Signals‘s Campfire for chat messaging. We’re all in the room all day. I thought this was a great place to be notified of certain things going on in the environment so I created this Powershell script. I was able to cobble something together. This script does a call to Campfire’s API and passes all the appropriate XML. You will require the room number, token and message body as parameters. You can find the room number by looking at the URL when you’re in the room. You can find the token by going to My Info when you’re in Campfire. The message body is simply the text you’d like to see as a message. You can also post sound messages as well which are pretty entertaining. I had to create a dummy user and use that user’s token. If you were to use […]

Read more

Here Is My Java Cleanup Script

As a ConfigMgr admin, I write all kinds of script to manage software on workstations. This week brought about a need to deploy the latest version of Java. Actually, deploying Java is a piece of cake that requires a single line with a few command line switches. The kicker is cleaning up the machine first of previous Java badness. If left unattended, Java can spread like wildfire in an enterprise. When I ran a report to find out what the Java landscape looked like in my environment, I found 62 different versions Java! This was from years of users clicking Yes to auto-update prompts, websites forcing Java and, however, else it got spread. I’m still in the planning stages of this massive cleanup and upgrade effort. Here’s the cleanup script I wrote with help from Kristoffer @ 3techies.com. Other than finding and uninstalling all versions of Java, I included an […]

Read more

Automate Downloading Patches in a Qualys Vulnerability Report

Here’s a very convenient script that save you a ton of time although it’ll only apply to a fairly small niche. My client has a Qualys vulnerability scanner that they use periodically to scan for security issues, missing patches, etc. This device scans the device and then produces a report of the actions you need to take to fix the vulnerabilities it found. A lot of the entries are for missing updates. The report conveniently gives a Microsoft link to download the required patches. However, we were finding that on some of the servers there were dozens of patches to download and apply. Here’s my first attempt at automating this process. This script takes an export of the Qualys report in MHT format. It then searches the report for any link that matches the OS of the server. If it finds one, it then follows the link, downloads the patch […]

Read more

Powershell Script: Remove certificates via Powershell

How to Remove a certificate via Powershell Script? Here’s a really quick powershell script that helped me out today. Last night I moved over an Active Directory Certificate Services server from a 2003 server to a Server 2012 box. During this move I decided to reissue certs to all computers. This is the part of the script I used to deploy via SCCM to remove the old certs.

Read more

Use Powershell to Append Data to an Excel Spreadsheet

As you learned in my previous post my client has a change management process. It includes filling in forms in a PDF and appending a row to an Excel spreadsheet. Here’s the code I’ve used to append to the spreadsheet. This was pretty straightforward other than finding the first row to add to and stopping the Excel process. This spreadsheet has a border around all the cells. The Excel COM object treats this as being “in use”. This means you’ve got to get the value of the cell “in use”. If it’s $null, then I know there’s no text in it. When I went to close the COM object, excel.exe would never stop. This is why you see three different ways of killing it off; the Quit() method, releasing the COM object and finally I just kill the process completely.

Read more

You Can Use Powershell to Fill Forms in a PDF

Whenever I first started using Powershell, I thought it’d only be used for IT admin stuff. I was expecting it to manage Windows services, start/stop computers, add users to Active Directory, etc. I didn’t even fathom doing other routine tasks like filling in PDF forms. It just goes to show you expect the unexpected with Powershell. Here’s a script I created to automate making a change request in my client’s environment. They have a pretty rudimentary process that entails filling out a PDF and then adding a row in an Excel spreadsheet. I wanted a single place to do both of these tasks so I decided to write a quick script. This is the piece of the script that fills in the PDF fields. I could never have even attempted this if it weren’t for the iTextSharp PDF library. The library did all the heavy lifting. I was just a […]

Read more

Here Is Why You Should Automate Your VPN Connection

I’m lazy. I don’t want to do anything twice, and if you read my blog I have a feeling you’re just as lazy as I am. I’ll automate anything! Here’s a prime example. Rather than waste 30 seconds of my time every day when I VPN into my client’s site and fire up remote desktop, I want to do it with a script. All this script does is connect to a VPN gateway then connect to a device via remote desktop. It’ll save you 25 seconds of your time every day, but it’ll easily save you an hour’s worth of time over the year! I use this with the older Cisco IPSEC VPN client so I make no guarantees with other VPN clients. To prevent typing in your RDP password every time, save your RDP credentials to a file.

Read more

Managing a Write Filter Remotely

I manage around 900 thin clients in my client’s environment. They’re mostly all hpT* models. Recently, a policy was implemented to ensure the enhanced write filter (EWF) was disabled on all of them. Rather than loading up HP’s way of doing this through HP Device Manager I decided Powershell could do the job just as well. I also didn’t have to load some bloated software on a server somewhere! HP has an EXE called ewfmgr.exe that manages the write filter locally. However, there’s no way to natively do this remotely. I wasn’t about to remote to the console of 900 thin clients and run the command. Powershell to the rescue! I decided to write two extremely simply cmdlets to get the job done. 95% of this code is just setting up the cmdlets. The real meat simply uses Sysinternals’ tool PSEXEC to kickoff the ewfmgr EXE and report back the […]

Read more

ConfigMgr: How to Find Failed Packages with Powershell

I try to take 1 day out of the week to manage the health of my SCCM infrastructure. One of the activities I was doing every Monday was checking the status of each package. If it failed, I’d then have to check the distribution point that it failed on and troubleshoot why it failed. It was extremely time consuming. One of my ongoing projects is to automate the majority of this infrastructure health check. This one-liner is my first contribution. This is an extremely simple one-liner. However, the problem was not writing the script; it was finding out where the data I needed was stored in WMI. Luckily, with a little help from this MyITForum post I was able to make it happen. I haven’t changed it up much from that post but what I did do is simply output the package ID and the DP that the failure occurred […]

Read more
1 21 22 23 24