February 2012
10 posts
7 tags
Exporting a Hyper-V virtual machine using...
I know I’m a little VMware-centric when it comes to PowerShell and virtualization. This shouldn’t be too surprising with the features of PowerCLI combined with our PowerVI VMware tool.   I thought I would venture off that path with a blog post I found by Ben Armstrong that explains how to export a Hyper-V virtual machine using PowerShell - I need to automate the process of exporting...
Feb 17th
4 tags
Domain Groups and PowerShell
Jason Hofferle has a nice post on Adding Domain Groups to Local Administrators Group with PowerShell.  Basically Jason ran into a problem adding domain groups with long names using NET.EXE, so he had to come up with a PowerShell solution. That’s right, the NET.EXE /ADD command does not support names longer than 20 characters. If net localgroup /add is being used in a computer startup script, the...
Feb 15th
3 tags
Deep Dive on what should be a simple cmdlet
Under the Stairs has a rather deep dive into the Get-ChildItem cmdlet.  You would think that a PowerShell cmdlet that is used as often as Get-ChildItem wouldn’t have many secrets or gotcha’s, but Thomas points out several items that are easy to forget. I saw a good question the other day in the PowerShell.Com Learn PowerShell Forum which related to using –Include when calling...
Feb 13th
3 tags
PowerShell Module for Splunk
Add Splunk to the list of products that can be managed by PowerShell. Splunk is used to monitor software applications, systems and infrastructures.  According to their blog, they are previewing a PowerShell module as well. Earlier this week Splunk launched a preview of the PowerShell Resource Kit on Github. It is designed to help Splunk admins who want to automate administration of their Splunk...
Feb 10th
Poll: PowerWF, PowerSE and .NET 4.0
Do you think we should increase the minimum requirement for PowerWF/PowerSE to .NET 4.0?
Feb 9th
4 tags
Feb 8th
1 note
4 tags
PowerShell to submit SQLServicePack job to...
Max Trinidad at The PowerShell Front had an interesting post that I’ve been meaning to link to - “QuickBlog – Use PowerShell to submit SQLServicePack job to multiple Server”  I just confirmed that’s possible to submit an unattended SQL ServicePack installer as a job using PowerShell Remoting. I’m using my Hyper-V Virtual Domain I ran the script from a Windows 7 VM and submitted...
Feb 7th
1 tag
Multiplying Strings in PowerShell
One feature of PowerShell has always baffled me; why would anyone ever want to multiply a string?  Of course Scripting Guy Ed Wilson had a use case for it. One of the really cool things that I use the string multiplication trick to do is to create an underline that is exactly the same length as the string it highlights. To do this, I use the Length property of the string and supply that to the...
Feb 6th
3 tags
2012 PowerShell Scripting Games
Are you playing in the 2012 PowerShell Scripting Games? There will be two categories: Beginner and Advanced. Just like last year, the beginner’s division is really for beginners. If you have been wanting to learn Windows PowerShell, but you did not know how to go about it, you definitely need to sign up for the 2012 Scripting Games to give yourself a bit of added incentive. If you want to take...
Feb 3rd
3 notes
7 tags
Disabling a View Pool with PowerCLI
Rob Daniels at ClearPath Solutions Group has an interesting post on disabling a view pool for VMware.  He points out that there isn’t currently a PowerCLI command to do it, but came up with a PowerShell solution anyway. Have you ever wanted to disable a VDI pool from the command line, but couldn’t find the right command for the job? As simple as it may seem to do, VMware has yet to equip...
Feb 1st
January 2012
9 posts
5 tags
PowerShell Implicit Remoting and VMware
Jason Hofferle has a nice post that discusses using PowerShell implicit remoting to take advantage VMware’s View cmdlets when you aren’t on the connection server. One of the differences between the VMware View cmdlets and PowerCLI is that the View cmdlets can only be run on the connection server itself. Despite the lack of a Connect-VIServer equivalent, with PowerShell Implicit...
Jan 31st
2 tags
Best Practices for Developing and Presenting SLA...
I saw that PowerWF champion Chris Ross is giving a presentation on SLA’s (Service Level Agreements) in System Center on Thursday. In this co-hosted webinar, Chris Ross from Catapult Systems will join Rob Reyes from Bay Dynamics.Topics will include: What is an SLA .. really Best Practices for developing SLAs for your System Center infrastructure Leveraging the power of Service Manager ...
Jan 30th
2 tags
PowerShell Scheduling
Jeffery Hicks is working on a PowerShell scheduler that looks pretty promising. Today’s Friday Fun is a continuation of my exploration of ways to use Start-Job. A few weeks ago I wrote about using Start-Job to create “scheduled” tasks. I realized I could take this further and turn this into a sort of alarm clock. The goal is to execute at command at a given time, but I wanted to make it easy to...
Jan 27th
3 notes
3 tags
PowerShell Function Primer
Richard Siddaway at IT Knowledge Exchange answers a very basic question that many new PowerShell scripters run into - Once I create a function, how do I use it. Most of my scripts end up being functions because I will eventually combine them into modules My recent script function get-logedonuser { param ( [string]$computername = $env:COMPUTERNAME ) Get-WmiObject -Class Win32_LogonSession...
Jan 25th
3 notes
3 tags
PowerWF v2.7 Released
Devfarm Software, a Windows 8 Launch Partner, today announced the release of version 2.7 of the award winning PowerWF. With this release, PowerWF begins the transition from a popular PowerShell workflow orchestration tool to a complete windows automation platform. For the past 3 years PowerWF has seamlessly combined Windows PowerShell with Workflow technologies to provide users with...
Jan 24th
40 notes
3 tags
Jan 24th
1 note
5 tags
VMware Cluster Capacity Check
Jonathan Medd has posted another useful PowerShell/PowerCLI script.  This time he is looking at Cluster storage capacity. I recently needed to provide a high level capacity overview per VMware cluster looking at some metrics of interest that were being used as a guide to the capacity state of a cluster. Note: these are by no means definitive or the ones you should be using in your environment,...
Jan 23rd
3 tags
Monitor Services with PowerShell
Jonathan Medd has a new post that shows how to insure that all Windows Services that are set to Automatic, are actually running. I needed to […] check that all of the Windows Services set to Automatic successfully started after the reboot. This should be pretty straightforward since we have a Get-Servicecmdlet. Unfortunately however, this cmdlet does not return a StartMode parameter,...
Jan 20th
5 notes
3 tags
PowerShell is key to the Future of Exchange...
Tony Redmond at WindowsITPro has a new post on the future on Exchange administration.  Not surprisingly, PowerShell is at the heart of his discussion. Microsoft is heading towards a world of automated management based on PowerShell in Windows Server 8 Exchange 2010 is close to where Microsoft wants to go because it already uses web-based consoles and Remote PowerShell The trend will...
Jan 19th
36 notes
December 2011
26 posts
3 tags
Count Running Virtual Machines on Datastores
Found another good candidate for a PowerVI script at vNiklas.djungel.se. If you are running too many VM´s on your datastores in your vSphere environment you can have some problems, this if your SAN is not VAAI compliant and can handle SCSI locking etc. Alan Renouf has made a blog post about how to get a report about how many VM´s you have on every datastore, I have extended to only report on...
Dec 30th
5 notes
4 tags
PowerShell v3 and Workflow
The Microsoft PowerShell development team is starting to talk about the addition of Workflow to PowerShell v3.  As Hal points out - A workflow is a sequence of automated steps or activities that execute tasks on or retrieve data from one or more managed nodes (computers or devices). These activities can include individual commands or scripts. Windows PowerShell Workflow enables, IT pros and...
Dec 29th
10 notes
7 tags
Alan Renouf's Top 5 PowerCLI Scripts
Alan Renouf has posted his top PowerCLI scripts of the week (a couple are from PowerWF friend Luc Dekens).  There are scripts on High Availability, Storage DRS, getting VMware Views, and virtual machine start up scripts.
Dec 24th
2 notes
5 tags
Windows Azure Node PowerShell Primer
WindowsAzure.com has a nice primer on using PowerShell with Windows Azure Node.js. What Is Windows Azure PowerShell for Node.js Windows Azure PowerShell for Node.js provides a command-line environment for developing and deploying Node applications for Windows Azure through a few Windows PowerShell cmdlets. The following tasks are supported: Import publishing settings to enable you to deploy...
Dec 23rd
24 notes
4 tags
Custom PowerShell Module Installation - Best...
If you are authoring your own PowerShell modules using PowerSE or PowerWF, you should check out this post on Module Installation Best Practices by PowerShell MVP Oisin Grehan. I’m seeing a few errant companies have their installers throw their modules into ${env:systemroot}\WindowsPowerShell\1.0\Modules but this is not the right place. The only things that should go there are core operating...
Dec 22nd
13 notes
1 tag
Don Jones Quote
From PowerShell MVP Don Jones Remember my PowerShell Proverb: Every time you write a script that outputs text, God kills a puppy. It’s on your head. WOW! At least he tells you how to avoid this fate.
Dec 21st
1 note
4 tags
Exchange 2010 Room List Report from PowerShell
Mike Pfeiffer has a nice write up on querying a list of conference rooms in Exchange 2010 using PowerShell. If you work in an campus type of environment, where you have conference rooms spread out across multiple buildings or physical sites, you may have heard of the Room Finder functionality introduced with Exchange 2010 and Outlook 2010. The Room Finder allows users to easily locate a room...
Dec 20th
78 notes
2 tags
Adding PowerShell In Context From Windows Explorer
I’ve been finding a lot of useful tricks and tips at Petri recently.  The other day they posted information about how to launch PowerShell, in context, from the popup menu in Windows Explorer. I am sure most of us prefer to use the quick menu that appears when we right click on any Windows object. Let’s have a look on the menu we get when we press shift +right click on a folder in...
Dec 19th
1 tag
PowerWF Sample Workflows - Windows Updates
PowerWF ships with a number of sample workflows to provide value right out of the box.  Under the Windows Admin section, there are several workflows that analyze your Windows Updates. Get All Windows Updates Get Successful Windows Updates Get Failed Windows Updates Get Last 10 Windows Updates Get Last 10 Successful Windows Updates Get Last 10 Failed Windows Updates These workflows all...
Dec 18th
2 tags
More On Formating Text With PowerShell
I did a few blog posts discussing building up XML with PowerShell and exporting PowerShell data to XML. Sean Kearney has nice post that discusses outputting PowerShell data as an RTF file. Here’s an interesting idea I have been playing with. Creating an RTF document within Powershell. Why RTF? RTF is “Rich Text Format”. If you haven’t ever looked at the format of one,...
Dec 17th
10 notes
5 tags
How to Change ESX Host Root Password
Did you know that PowerVI includes a PowerShell script that lets you change the root password on multiple ESX host at one time.  This is useful if you have a policy to change the passwords regularly, but want to keep the password the same across all hosts. To change the password - Make sure PowerVI is installed. Open the vSphere client and connect to your vCenter Select all of the ESX Hosts...
Dec 16th
13 notes
2 tags
Get a List of Installed Software from ConfigMgr...
Trevor Sullivan has a nice post on using PowerShell to query System Center Configuration Manager (SCCM) to determine what software is installed on a system. Let’s say you’ve got Microsoft’s System Center Configuration Manager (SCCM / ConfigMgr) in your IT environment (and if you don’t, why on earth not!). If you’re on the desktop management team, you might occasionally get requests from...
Dec 15th
2 notes
1 tag
A PowerShell Console Bar Graph
Jeffery Hicks does something fun with PowerShell every Friday.  Last week he created a little script that creates a horizontal bar graph directly in the PowerShell console. I think you’ll like this. Normally, I prefer my PowerShell commands to write objects to the pipeline. But there’s nothing wrong with sending output directly to the console, as long as you know that the output is intended...
Dec 14th
2 tags
Devfarm Software Announces PowerSE OEM Integration...
St. Louis, MO (PRWEB) December 13, 2011 Devfarm Software, a Windows 8 Launch Partner, today announced the start of a PowerSE OEM Integration Program. PowerSE is the script editor that is embedded in Devfarm’s flagship product, PowerWF – Visual PowerShell Orchestration. The PowerSE OEM Integration Program allows third party applications to integrate quickly and easily with the state-of-the-art...
Dec 13th
3 tags
Blog Short: Bored Wookie on PowerCLI
The Bored Wookie has a basic introduction to PowerCLI for VMware automation.  Even if you already have a basic understanding of PowerShell and PowerCLI, you should click through just to see the blogs title bar.
Dec 12th
4 tags
SQL and PowerShell
SQL Server Central [registration required], has a blog post on Johan Bijnens journey from being apathetic about PowerShell to becoming a PowerShell advocate for SQL Server. If you’re involved with SQL Server, you will have noticed a lot of commotion around Powershell, as people push for it in the context of SQLServer. A good friend and inspiration of mine, Allen White...
Dec 11th
1 note
3 tags
Top Server 2008 Tasks with PowerShell
Jeff Hicks has written a two part series on the Top 10 Server 2008 Tasks with PowerShell.  The second installment has links to solutions for all ten tasks. Change the local administrator password with PowerShell Restart or shutdown a server with PowerShell Restart a service with PowerShell Terminate a process with PowerShell Create a disk utilization report with PowerShell Get 10 most recent...
Dec 10th
3 notes
7 tags
Cmdlet Name Conflicts
Don Jones has a short article on PowerShell cmdlet name conflicts.  The article discusses what happens if multiple PowerShell modules have cmdlets with the same name, such as Get-VM which could show up in a HyperV and VMware/vSphere/PowerCLI module.  It is a short article, but worth a quick read to understand how PowerShell handles these conflicts.
Dec 9th
2 notes
2 tags
More On Building Up XML With PowerShell
James O’Neill has a new blog post discussing PowerShell strings and provides a specific example which creates an XML document from a string template with embedded PowerShell variables. … the real XML was much more complicated. Using the tool which builds the XML file from scratch takes about an hour per file. The XML files then go into another tool which is where the real magic...
Dec 7th
3 notes
2 tags
Regular Replacements
As I mentioned before, Tobias at PowerShell.com has written a follow-up of his primer on using PowerShell regular expression, focusing on using regular expressions to slice and dice text.  He has added a third installment to the series that looks at using Regular Expressions to perform string replacements. In Part 1, you lerned how Regular Expressions can extract useful information from noise...
Dec 6th
1 note
3 tags
Get HashTable Max Value
@XCUD had another interesting chat the other day related to Hash Tables.  He was going to blog about it, but he’s busy working on some very cool features for the next version of PowerWF. Anyway, the question was, what is the easiest way to find the max value in a Hash table.  We decided it was easiest to sort the hash table and then return the first value.  Here is an example (albeit  a...
Dec 5th
1 note
4 tags
Exchange Managment using PowerShell and PowerSE
As I mentioned the other day, I’ve installed PowerWF and PowerSE on my Exchange Server so I could start building some real-world samples for Exchange administrators.  The first step was to get access to all of the native features that you get from the Exchange Management Shell. Basically the Exchange Management Shell is essentially the PowerShell console with its own profile and some basic...
Dec 4th
81 notes
5 tags
PowerShell and Twitter
Doug Finke had a blog post the other day that talked about using PowerShell v3 to find out about your twitter followers … This script lets you see your Twitter followers name, screen name and location. Using the new Invoke-RestMethod in PowerShell Version 3, it retrieves and converts the JSON to make it easily accessible in PowerShell. Did You Know: PowerWF ships with a Twitter...
Dec 3rd
1 tag
Calendar Prompt
Building off of Jeffery Hicks Christmas Prompt example and my own persistent hash table example I came up with this script.  $global:myEvents = @{} $global:myEvents = import-Clixml c:\Public\myEvents.xml function update-Event($key, $value) { if($global:myEvents.Contains($key)) { $global:myEvents.Remove($key) } $global:myEvents.Add($key,$value) $global:myEvents |...
Dec 2nd
4 tags
SCSM User Group Recap - Video of PowerWF In Action
PowerWF for Service Manager (SCSM) was highlighted at the December 2011 SCSM User Group.  Topics discussed include: SCSM 2012 Implementation Briefing from Acceleres Extending Service Manager with PowerWF SCSM 2012 News General Q&A for SCSM 2010/2012 2012 Release Request Activities and SSP Example Demo from Travis Wright Click over to watch the video.
Dec 2nd
3 tags
Use PowerShell to Clean SCCM
Trevor Sullivan has a nice PowerShell script that removes expired and superseded updates from System Center Configuration Manager (SCCM). A common complaint I hear about Microsoft System Center Configuration Manager (SCCM / ConfigMgr) 2007 is the ability to clean up expired and superseded software updates from the objects related to software updates. As software updates are marked as expired...
Dec 1st
2 notes
November 2011
29 posts
2 tags
Persisting a Hash Table
I was on a chat earlier today with one of our users.  I’m not sure why, but he  wanted to find a way to persist a Hash Table between PowerShell sessions.  I was pretty sure the both Ed Wilson and Jeffery Hicks had addressed similar problems in the past, so I gave him links to their sites, but I figured there was probably a pretty easy way to do this.  Here’s what I came up with as a...
Nov 30th
1 tag
Fun With PowerShell Prompts
Jeffery Hicks had a fun post on Friday talking about creating a custom PowerShell Prompt that counts down the days until Christmas. Over the last few weeks I’ve read about other people’s PowerShell prompts and offered a few suggestions of my own. This week’s Friday Fun creates colorful holiday prompt that counts down the number of days until Christmas. The function, uses a simple timespan...
Nov 29th
3 tags
PowerWF for Exchange
I installed PowerWF on our Exchange 2010 server today so that I could start creating some Exchange specific sample workflows.  I knew the Exchange PowerShell module had a lot of cmdlets, but I had forgotten that there were close to 1000.  The nice thing about PowerWF is that it makes it easy for me to investigate all of these cmdlets. Expect me to post a lot of Exchange related posts in the...
Nov 28th
78 notes
4 tags
How to Export PowerShell Data to XML
I saw a question on StackOverflow the other day asking how to save PowerShell results as XML.  If you are lucky, this could be as simple as using the export-clixml cmdlet. But what if you are doing something more complex where you are pulling data from multiple sources or you want to control every aspect of the structure of the XML you are creating.  In that case, I think you have 2 options. The...
Nov 25th
3 notes
3 tags
Jeffery Hicks Interview Mentions PowerWF
Petri has an interview with Microsoft PowerShell MVP Jeffery Hicks talking about the importance of PowerShell.  In the video interview Jeffery mentions PowerWF as a way to work with PowerShell using a GUI interface instead of a command line or traditional script. - Thanks Jeffery.
Nov 24th
1 note