Category Archives: powergui

PowerGUI® Pro and PowerGUI® 3.0 Released

Having been using the beta for a while, I was very pleased to see that PowerGUI V3 has been released. Some of the new features / fixes that I like the best are:

  • Create Executable from Script
  • One click install for PowerPacks
  • PowerCLI 4.1 Support in the VMware PowerPack

Have a look at Kirk’s site for full details

http://poshoholic.com/2011/07/15/powergui-pro-and-powergui-3-0-are-now-available/


Find-Me -At PowerGUI.org

PowerGUI Challenge 2010

Kirk Munro, PowerShell MVP, has announced this year’s PowerGUI PowerPack contest. Create a PowerPack or Add-On for PowerGUI and you’ll be in with a chance of a prize if you are deemed to be one of the winners. The prizes are high value Amazon.com vouchers, however both Alan Renouf and I will testify to the fact that winning can give your profile and IT career a real boost!

So I’d encourage you to enter and believe me you will also learn something too from putting a PowerPack together and feel good for making a community contribution.

Looking forward to seeing what people contribute.

PowerGUI Challenge 2010

Updated Exchange 2003 PowerGUI PowerPack

Since PowerGUI version 1.8 there have been some great enhancements in PowerPack management. So I finally got round to updating the Exchange 2003 PowerPack and publishing it in the new format. One of the best new features is the ability to update the PowerPack from the application – previously you had to manually download the new version, remove the old one then import the updated copy.

Within the PowerPack Management Dialogue Box you can see the current version of your PowerPack:

PowerPackManagement1

If you click on the Check for Update button PowerGUI will check for an updated version of the PowerPack whether it be on the PowerGUI website or on a locally availbale file share. If there is a new version then you are prompted to download it and upgrade:

PowerPackManagement2

Answer Yes and the updated PowerPack will begin to download:

PowerPackManagement3

Once complete you will see it has been updated to the new version:

PowerPackManagement4

By default PowerGUI will check for updated PowerPacks everytime you open it:

PowerPackManagement6

If you are a PowerPack creator then you can specify the location of your PowerPack. PowerGUI will automatically update the version number for you whenever you save any changes to it:

PowerPackManagement7

Its as simple as that!

As an extra bonus I have added a new script node to the PowerPack which examines the event log of an Exchange 2003 server and reports the whitespace in each database for you.

PowerPackManagement5

Creating Custom Shortcut Keys In PowerGUI

The PowerGUI script editor for PowerShell has long been my IDE of choice. I regularly use its facility to ‘Copy As HTML’ so that I can copy slices of code into blog posts with nice colour formatting. Yesterday I was thinking it would be nice to have a shortcut key to do this rather than have to navigate the menu each time, so I made a post on the forums asking for a feature request, but Shay pointed out that it was already possible to do this.

If you navigate to Tools, Customize, Keyboard, you will see the below which lists anything you can create a keyboard shortcut for:

Customise1

It even has a nice search facility so in my case typing in HTML returns what I was looking for:

Customise2

Now simply Assign the key combination you wish to use for the shortcut, save the changes and off you go. Nice!

Customise3

Exchange 2003 / WMI / PowerShell article over at http://www.simple-talk.com/

So I got asked to write an article for the http://www.simple-talk.com/ website, a well known online technical journal and community hub around SQL and .NET technologies. They’ve recently been branching out into Exchange as well hence they reason they were looking for some Exchange based articles.

The article I have written for them is based around a presentation I have made around some user groups a few times now, i.e. using PowerShell and WMI to manage Exchange 2003. I really enjoyed the process of transferring the content into a written article and hopefully I may get the opportunity to write some more so please check it out.

You can also take advantage of a free Sybex Best Of Exchange 2007 Server ebook by signing up for their Exchange newsletter.

Twitter PowerPack for PowerGUI

Having had some fun previously putting together some PowerPacks for PowerGUI, I had an idea that it would be quite a good tool to use with Twitter. One thing I found annoying with the web interface for Twitter was that it was difficult to see a full list for who you were following and who was following you – you could only see 20 people per page. After Steve Murawski put together his list of Powershell Twitterers at the Mind of Root website I started playing around with some of the ways you could use Powershell to access Twitter data.

Not long afterwards James O’Neill published some PowerShell Twitter functions on his blog which pretty much covered everthing I was looking to cover. If you are a Twitter and PowerShell user I seriously urge you to check these out because they are a really cool way to mess around with some of the data you can get from Twitter. The data is available in XML format, which with PowerShell is very straightforward to handle. The below example shows the Get-TwitterFriend function (I have tweaked James’ code slightly so that it returns all the people you follow, not just the first page of 100) . Essentially you supply some credentials, go get the XML page from the Twitter website, convert it into an XML object and access elements of the XML document since we can get to properties of the XML object.

Function Get-TwitterFriend {
 param ($username, $password, $ID)
 if ($WebClient -eq $null) {$Global:WebClient=new-object System.Net.WebClient  }
 $WebClient.Credentials = (New-Object System.Net.NetworkCredential -argumentList $username, $password)

 $nbrofpeople = 0
 $Friends = @()
 if ($ID) {$URL="http://twitter.com/statuses/friends/$ID.xml?page="}
 else     {$URL="http://twitter.com/statuses/friends.xml?page="}
 do {  $Friends += (([xml]($WebClient.DownloadString($url+($nbrofpeople/100 +1)))).users.user   )
                     # Returns the  user's friends, with current status inline, in the order they were added as friends. 
                     # If ID is specified, returns another user's friends
                     #id:    Optional.  The ID or screen name of the user for whom to request a list of friends.
                     

    $nbrofpeople += 100
    } while ($Friends.count -eq $nbrofpeople)
 $Friends
}

The XML from Twitter for a user looks like this.

<user>
<id>14691415</id>
<name>ebgreen</name>
<screen_name>ebgreen</screen_name>
<location>St. Louis</location>

<description>
IT Swiss army knife. Lots of powershell right now and VBScript always.
</description>

<profile_image_url>
http://s3.amazonaws.com/twitter_production/profile_images/53884662/ebgreen_normal.jpg
</profile_image_url>
<url>http://ps.customdatasoft.com/blog/blog5.php</url>
<protected>false</protected>
<followers_count>111</followers_count>
<profile_background_color>1A1B1F</profile_background_color>
<profile_text_color>666666</profile_text_color>
<profile_link_color>2FC2EF</profile_link_color>
<profile_sidebar_fill_color>252429</profile_sidebar_fill_color>
<profile_sidebar_border_color>181A1E</profile_sidebar_border_color>
<friends_count>164</friends_count>
<created_at>Wed May 07 20:31:13 +0000 2008</created_at>
<favourites_count>6</favourites_count>
<utc_offset>-21600</utc_offset>
<time_zone>Central Time (US & Canada)</time_zone>

<profile_background_image_url>
http://s3.amazonaws.com/twitter_production/profile_background_images/6936948/samjoebbed.jpg
</profile_background_image_url>
<profile_background_tile>true</profile_background_tile>
<statuses_count>474</statuses_count>
<notifications>false</notifications>
<following>0</following>

<status>
<created_at>Mon Apr 27 20:47:23 +0000 2009</created_at>
<id>1632413267</id>

<text>
You did sort of ask for it. RT @cshanklin: I desperately need a retweet filter.
</text>
<source><a href=”http://twitterfall.com”>Twitterfall</a></source>
<truncated>false</truncated>
<in_reply_to_status_id/>
<in_reply_to_user_id/>
<favorited>false</favorited>
<in_reply_to_screen_name/>
</status>
</user>

So to access some of these properties we could do something like this:

Get-TwitterFriend $userName $password | Select-Object name,screen_Name,url,id 

Rather than try re-inventing the wheel and consequently saving myself a bunch of time for the PowerPack, I took these pre-made functions and plugged them into PowerGUI. The results for the initial release are the below:

twitternodes

So if you run the above Get-TwitterFriend function in the PowerPack you get a nice grid view of the people you follow and can easily sort them into alphabetical order by clicking on the Name column.

get-twitterfriend23

One of my favourite things is the ability to search Twitter for a particular subject and return the Top 20 people who have posted about that subject recently – this is great if you are looking to check out a particular community to find who might be good people to follow. For instance if you wanted to check out who’s talking about PowerShell on Twitter you would get some results like the below:

top20powershell

Another thing you may find useful in the pack is to check out some of the lists of people published on websites who are known to talk about topics on Twitter, so far I have included the list of PowerShell Twitterers over at the Mind of Root website and Alan Renouf’s list of people who talk about VMWare. I’ve included an action in the PowerPack which once you have pulled down the link and either selected some or all of the people from the list allows you to add them to the list of people you follow on Twitter.

add-twitterfriendfromlist

There’s other stuff in the PowerPack, I encourage you to go check it out; give me any feedback, particularly stuff you might like to see added and also check out James’ PowerShell Twitter functions on their own.

Hope you find it useful.

PowerGUI webcast – Exchange 2003 Powerpack demo

I was recently invited to record a webcast by the Product Manager at Quest for PowerGUI, Darin Pendergraft, demoing the Exchange 2003 Powerpack I made for PowerGUI.

They came up with the idea to make some videos / webcasts giving some community members the opportunity to show what PowerGUI can do. A lot of people primarily use it only as a script editor, but the management console side of things is brilliant once you get into it – hopefully these examples will help inspire more people to make some powerpacks.

I had a lot of fun recording the interview, it was funny to be on the other end of the questions for once, normally I’m asking them for the Get-Scripting podcast.

It runs for about 15 – 20 mins, I hope you enjoy it.

Take your own advice Jonathan!

During this last year I’ve done quite a few presentations about Powershell and quite often as part of the demo I have included PowerGUI since I find it a great way to reel people in who aren’t quite yet ready to make a jump the whole way to command line scripting.

One of the topics I usually talk about around this is how I (like most people seem to) initially used the PowerGUI script editor for writing my scripts, but didn’t really get what the PowerGUI console was all about. I couldn’t quite get my head around why you would want a

GUI console for a command shell to manage a GUI OS or product,

it didn’t seem to make much sense to me.

Luckily, we were very fortunate back in May to head over to Quest in the UK with the Powershell User Group for an evening’s event. I decided I’d better figure out what the PowerGUI console was for before attending so watched some of the videos on the PowerGUI site to give myself a better idea.

Doing that and seeing Dmitry’s presentation in the night made things finally click. You could use it to make custom management consoles for your own use or even better to give to a colleague or share with the community. That’s where the idea for the Exchange 2003 PowerPack was born and the Get-Scripting podcast was born almost by accident that night too, but those are stories for another day. 🙂

Anyway, back to the presenting. I often show PowerGUI and explain how you can use it to make custom management consoles to give to colleagues.

Recently I have been working out my notice period before heading to a new job and one of the things I have done during that time is create a bunch of scripts for the regular admin tasks I or others carry out (particularly with AD) which I never got round to writing for myself or them and to save whoever took on my role or parts of it a load of hassle.

For instance I finally got around to creating a script for de-provisioning users which should really help to improve the previous process which was in place. It was based on my good friend Jonathan Noble’s blog post about setting logon hours for an account rather than disabling it so that the email doesn’t bounce. Thanks Jon!

Of course some of these scripts were to be handed over to the helpdesk. Now without being patronising (because we have some very smart people on our helpdesk) it can be quite a jump for a helpdesk person to read through all the documentation I wrote for each script and start running those scripts from the command shell and seeing their results in a blue on black window.

So the cogs started whirring away in the old brain whilst I tried to think of a better way I could deliver these scripts for the helpdesk so they could get up and running with them much quicker and easier without having to read through all the boring documentation first and have a better experience when running them, i.e. don’t put them off using the scripts once I’m not there anymore to help them.

Finally it clicked. Why didn’t I take my own advice I’d been giving out all year about making management consoles for your colleagues and go and do it myself! So the AD Admin Powerpack was born, I packaged up my scripts into this PowerPack, installed PowerGUI for them and instantly the scripts were far more useable.

No need to read all of my boring documentation beforehand since its pretty obvious what clicking on script nodes such as ‘Find Expired AD users’ or ‘How many users in Active Directory?’ will do.

Effective, very simple solutions which save people time, make them more efficient and its makes me feel good to leave something useful like that behind for them to use. Thank you PowerGUI!

Of course the girls on the helpdesk love the train icon so it was an even easier win with them.