In the world of Windows, an account SID can be a very enigmatic thing. Who is S-1-5-21-2250542124-3280448597-2353175939-1019? Fortunately, many applications, such as the event log viewer resolve the SID to an account name. The downside, is that when you are accessing that same type of information from PowerShell, you end up with the “raw’ SID….
Tag: PowerShell
Friday Fun: Pi-romania
I was doing some benchmarks the other day, and one of the tests was a calculation of pi using a particular algorithm. I found that quite interesting and naturally this made me curious if I could do the same calculation in PowerShell. Of course, if all you need is the value of pi, that is…
Techmentor Las Vegas 2013 Session Materials
I had a terrific time at Techmentor last week in Las Vegas. I did 2 3-hour sessions. The longer sessions are intended to allow speakers time to go deeper into content and offer more detailed coverage than what you might get at a conference like TechEd. From my informal survey of attendees, many people enjoyed…
Friday Fun: Out-ConditionalColor
Last week I posted a Friday Fun article on parsing results from Invoke-Webrequest and displaying matching strings in color so that the book titles I’m interested in stand out. But the more I thought about it I realized I should take this a step further. The problem with Write-Host is that it doesn’t write anything…
Friday Fun Color My Web
Awhile ago I posted an article demonstrating using Invoke-Webrequest which is part of PowerShell 3.0. I used the page at Manning.com to display the Print and MEAP bestsellers. By the way, thanks to all of you who keep making PowerShell books popular. My original script simply wrote the results to the screen. But I decided…
A Better PowerShell Get Scheduled Job Results
Yesterday I posted a quick update on my code to get the most recent scheduled job result in PowerShell. I had been using a simple script. But the more I thought about it, the more I realized I really did need to turn it into a function with more flexibility. When creating a PowerShell based…
Get Most Recent PowerShell Scheduled Job Result
I think I’ve posted this before, but in any event even if I did, I’ve tweaked this code a bit. When you create a scheduled job in PowerShell 3.0, by default PowerShell will keep results on disk for the last 32 times the job ran. This can make it a little tricky if you want…
Friday Fun: Get Friday the 13th
I thought it might be fun today to use PowerShell to discover all the Friday the 13ths in a given year. So I put together a simple PowerShell one-liner. To make it flexible I’ll use a variable for the year, using the current year as my value. $year = (Get-date).Year Because there can only be…
PowerShell 4.0 A First Look
My first look at PowerShell 4.0 is now online at 4Sysops.com. A few interesting bits but with 3.0 still gaining traction I’m wondering how much people will actually adopt 4.0. It seems to me that some of the biggest features like Desired State Configuration will require Windows Server 2012 on the back end and it…
Friday Fun: Get Day of the Year with PowerShell
Earlier this week I was having some fun with @EnergizedTech on Twitter, playing around with dates in PowerShell. I’m not even sure where we started but the experience got me thinking and it’s Friday so let’s have some fun. While I can easily find out what the day of the year is for a given…
Hyper-V Waiting to Merge
In my Hyper-V environment I have a test domain which I use for pretty much all of my training, writing and video work. As part of my “belt and suspenders” approach, I periodically take a snapshot of all the virtual machines using the theory that if I had to, I could roll back the entire…
Creating Styling HTML Reports with PowerShell
Last month I did an updated version of my presentation on creating styling HTML reports in Windows PowerShell. This presentation was for the PowerShell virtual chapter of SQL PASS. As such, I came up with some SQL related demonstrations and fine tuned some demos from earlier presentations. You can download a zip file with a…
PowerShell Deep Dives is published!
>At long last the PowerShell Deep Dives book, published by Manning, is a reality! The book is a collection of PowerShell nuggets, tidbits, tutorials and tips that you won’t find anywhere else. Even more importantly, this is a book with a mission. None of the contributors or editors receive any payments for the book. All…
Friday Fun: New-Thriller Revised
A few years ago I posted a PowerShell script to autogenerate a synopsis for a standard thriller. It was a lot of fun and demonstrated out to build complex strings using the -F operator. I decided to revisit this script and tweaked it some. The main change is that instead of using the -F operator,…
Friday Fun: Quote of the Day Revised
This week TrainSignal has been running a contest to celebrate my new PowerShell 3.0 course . All you have to do to win is enter some off-the-wall, silly or non-production use of PowerShell. I’ve posted a few examples on the TrainSignal blog this week. These Friday Fun posts I write also follow the same idea….