PowerWF News, Tutorials, and more...

Get the latest tips and tricks directly from the PowerWF development team. Find out about new releases and upcoming features.


Seamless Automation

From the Desktop to the Data Center

The PowerWF family of products are easy enough for desktop and departmental automation, yet powerful and scalable enough for the Data Center. PowerWF compliments Opalis and other RBA solutions, lets you leverage your workforce and preserves your investment as your automation needs grow.


Special - 20% Discount


In conjunction with our recently announced Silver Award from Windows IT Magazine we would like to offer our customers an opportunity to save 20% off any Devfarm product purchase through the end of the year. This includes all PowerWF products as well as Devfarm's new PowerVI product!

PowerVI

vSphere Automation fueled by PowerShell


Designed for the VMware Administrator, PowerVI eases the automation of vSphere infrastructures. PowerVI includes over 100 PowerShell automation scripts that simplify everyday VMware administration tasks and PowerVI makes it easy to author new scripts.
February 17, 2012

Exporting a Hyper-V virtual machine using PowerShell

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 a virtual machine recently – and when I checked around I found that while there are a number of sample scripts out there that show you how to do this (some even on this blog) they are all written in VBScript.  As I am now to the stage where PowerShell is my preferred scripting language – I sat down and wrote up this short script:

(read more and get script)



February 15, 2012

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 groups with long names just won’t be added.

So the traditional batch file startup script was replaced with a PowerShell startup script,

(read more and get script)



February 13, 2012

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 Get-ChildItem (or DIR, or LS!). The OP had a bunch of files in a folder (C:\Data) and wanted to get at just the *.txt files as follows:

Get-ChildItem –Path C:\Data –Include *.Txt

But it did not work – it returned no files at all (even though there were some in the folder. The reason is clear if you read the great help text closely: the Include switch is only active if you are also using the –Recurse parameter! Another small to make is that the –include property specifies a globbed string (I.e. a file name specified with Wild cards) and not a regular expression.

The simplest way to just get the text files form a single folder would be:

Get-ChildItem –Path C:\Data\*.Txt

Another way to get just the Text files in a given folder would be to use the –Filter parameter. The –Filter parameter  is sent to the provider and is used to qualify the –Path value. You can call it like:

(read more and get more sample code)



February 10, 2012

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 deployments, but also has some pretty cool recipes for integrating Active Directory with Splunk, forwarding alerts and other data to Microsoft’s System Center Operations Manager, and performing a rudimentary topology discovery via an automated Splunk search with PowerShell.

Many of Splunk’s customers monitor very large Windows environments that have hundreds if not thousands of Universal Forwarders. They also use Active Directory for authentication, policy management and general asset organization. It turns out that they also use PowerShell extensively. So, why not develop a Splunk module for PowerShell?

(read more and get sample code)



February 8, 2012

Intel has produced a new video that discusses their new Intel® vPro™ Technology Module for Microsoft Windows Powershell

-



February 7, 2012

PowerShell to submit SQLServicePack job to multiple Server

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 one job to two servers. I could see the the jobs processing on the server Task Manager.

But, it was tedious? If you’re a newbie maybe it’s a little over your head but not impossible. That’s the intention of PowerShell Remoting, to be able to do these things like this, and I’m just scratching the surface. Please, Take advantage of these features in PS V2.0, and more enhancements has been done in PS v3.0 with the inclusion of Workflows.

Still, you will need to use PowerShell “Enable-PSRemoting -force” in all the servers. I know, this may be an issue but you need to configure it on all the servers in order to take advantage of PowerShell Remoting. Now, I’m creating session on each computer so I can run as jobs, and your credential is Important to be included. All this is done from your desktop, no more running to the server room.

(read more)



February 6, 2012

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 multiplication operator along with the desired line separator to use. In the code that follows, I assign a string to the variable $a. Next, I use the Length property, which is a property that always exists on System.String objects, to determine the length of the string. I use the length of the string to determine how many times I want to multiply the underscore character (“_”). Next I display the string, and finally, I display the newly created underline. The code is shown here.

(read more and view code)



February 3, 2012

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 your skills to the next level, you will want to participate in the advanced category.

In a major departure from previous rules, if you want to compete by using the beta version of Windows PowerShell 3.0, you are welcome to use it. You will be limited to the most recent version that is publically available, and you must specify that when you submit your scripts.

I will be putting together the finishing touches on the Study Guide for the 2012 Scripting Games to help you in your study and preparation for the games. The Study Guide will be available on February 5, 2012.

(read more)

The Scripting Games start on April 2nd. Let us know if you play, and be sure to use your favorite PowerShell editor, PowerSE as you join in the fun.



February 1, 2012

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 the PowerCLI Snap-in with a “disable-pool” commandlet. Some may try to accommodate this by simply removing pool entitlements, but you can be faced with the following error:

Remove-PoolEntitlement : PowershellService::RemovePoolEntitlement FAILED, 
error=User with sid  has an active VDI Session on Pool . Entitlement cannot be 
removed until this session is terminated.
 

This error is the result of an active desktop session attached to the entitlement being removed, or worse, anywhere within the VDI system as this is a global property. What this means is that if a user has an entitlement to more than one pool, this command may fail every time. As a work-around, there is a value within the local ADAM database on the View broker server. It is a Boolean value with the name “pae-Disabled” and can be found in the vdi.vmware.int\Applications\ attribute of the local LDAP. Below is an example of how this value can be toggled from a script:

(read more and get script)



January 31, 2012

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 Remoting it’s still possible to use these cmdlets from a workstation.

First, PowerShell Remoting needs to be enabled on the Connection Server. There are several ways to configure remoting, but in a domain environment I like to turn it on with group policy. Enabling the automatic configuration of listeners is usually all the configuration necessary to enable remoting on a domain server, but lots of information is available for different situations.

(read more and get sample code)



 ::: Older Posts :::