I’m very excited to be in Redmond for a few days as part of the PowerShell Summit. I love catching up with old friends and making new ones all over PowerShell. If you couldn’t make it this year, and I know many of you will feel you are missing out, there’s always next year. We…
Category: PowerShell
Friday Fun: Get-Anniversary
Recently I celebrated a wedding anniversary. Even though I didn’t forget I could have used a little help. So I figured since I’m in PowerShell all the time anyway, it could help. I built a little script to remind me of important dates. Let me walk you through the key steps. First, I’ll define a…
Get Local Admin Group Members in a New Old Way
Yesterday I posted a quick article on getting the age of the local administrator account password. It seemed appropropriate to follow up on a quick and dirty way to list all members of the local administrator group. Normally, I would turn to WMI (and have written about this in the past). But WMI is relatively…
How Old is the Admin Password
Here’s a quick one-liner to find out how old the administrator password age (in days) is on a remote machine. ([adsi]”WinNT://<COMPUTERNAME>/administrator”).passwordage.value/86400 This requires RPC/DCOM access to the remote computer. Or use PowerShell remoting with Invoke-Command: invoke-command { new-object PSObject -property @{ Computername = $env:computername AdminAge = ([adsi]”WinNT://$env:computername/administrator”).passwordage.value/86400 } } -ComputerName $computers | Select Computername,AdminAge
Test Hyper-V VHD Folders with PowerShell
I’ve recently added a USB 3.0 Express Card adapter to my laptop to provide USB 3.0 functionality. The added performance is very useful in my Hyper-V setup. However, I am running into a glitch that I have yet to figure out where the external drives (the Express card has 2 ports) are still attached and…
PowerShell Books Rule
PowerShell related titles continue to rule the roost, at least for Manning. Based on recent sales PowerShell titles occupy 40% of the top 10 list! I’m hoping this trend will continue later this spring with publication of the PowerShell Deep Dives book which is currently available as part of Manning’s MEAP. As of March 14th…
Friday Fun PowerShell Puzzlers
This week’s Friday Fun is a short PowerShell puzzler which I hope you’ll have some fun with and maybe even lead you to look something up and how knows what that might lead to! The following scrambled terms are all PowerShell related. The ones asterisked are PowerShell 3.0 related, but you’ve probably heard about the…
WMI Explorer from The PowerShell Guy
Several years ago, The PowerShell Guy, aka MoW, wrote a fantastic graphical PowerShell script that was a WMI Explorer. With this script you could connect to a computer and namespace, browse classes and view instances. A great way for discovering things about WMI. However Marc has moved on to other things I think and his…
Friday Fun Get Beer List
Well, another Friday and what goes better with it than beer. Of course I should mix in a little PowerShell as well. I live in the Syracuse, NY area and we have a terrific local brewery, Middle Ages Brewing Company. Not only is there a tasting room, but I can also get growler refills. Middle…
PowerShell Deep Dive Authors at the PowerShell Summit
A question went out today about what authors of the forthcoming PowerShell Deep Dives book would be at the PowerShell Summit. We’re hoping to have the book out by then so you can get you hands on it. From what I can tell these authors will be at the summit: Adam Driscoll Jason Helmick Jeffery…
PowerShell Morning Report with Credentials
I had an email about trying to use my Morning Report script to connect to machines that required alternate credentials. For example, you might have non-domain systems in a DMZ. Fair enough. Since most of the report script uses WMI, it wasn’t too hard to add a Credential parameter and modify the WMI code to…
Set GPO Status with PowerShell
Last week I dropped in on a class Jeremy Moskowitz was teaching on Group Policy to talk a little PowerShell. I was demonstrating the Get-GPO cmdlet and talking about the object you get back and how you can use it to filter and create reports. One of the attendees asked about changing the status. What…
Building Excel Reports with PowerShell
Last year I wrote a series of articles for the Petri IT KnowledgeBase on using Microsoft Excel with PowerShell. Today I received an email from a reader who had a question about article that showed how to build a drive usage report in Excel. In the article I suggest it wouldn’t be too difficult to…
Rename Hashtable Key Revised
Last week I posted an advanced PowerShell function to rename a hashtable key. As usual, the more I worked with it the more I realized it was missing something – namely the ability the take a pipelined object. My original version assumed you had saved the hashtable to a variable. But as I was working…
Join PowerShell Hash Tables
I received a lot of feedback and interest in my ConvertTo-Hashtable function. One question I received was “Why?” Well, one reason might be that you want to combine two objects into a single object. Joining them as two hashtables makes this an easier process. First off, combining two hashtables is as simple as adding them…