Archive for the 'VBScript' Category

Deep Dive video: Integrating Powershell with Legacy Environments – Sean Kearney

One of the most energetic session recording from the PowerShell Deep Dive – the one by the one and only Energized Tech – PowerShell MVP Sean Kearney.

Sean shows how PowerShell can be friends with pretty much anything you already have in your environment: console applications, CMD/batch files, VBScript, you name it!

This is a live recording from US TEC 2011 PowerShell Deep Dive conference. TEC Europe is just around the corner – October 17-19th, 2011 in Frankfurt.Register today to get a discount.

See also:

Video: Automating GPO with PowerShell

Darren‘s “Automating Group Policy Management” session from DEC 2008 got posted on YouTube:

In the session Darren shows both VBScript and PowerShell ways of managing Group Policy – and he is using currently available APIs (including the free GPO cmdlets that his SDM Software produced) – so you don’t have to wait for Windows Server 2008 R2 to start using Darren’s scripts. Check it out!

P.S. Quite a few sessions from DEC 2008 got posted recently – check them all out here.

As I mentioned, TEC 2009 (they renamed it to TEC – The Experts Conference because of the Exchange track added) is going to have a lot more PowerShell and huge amount of new information on the latest directory, identity management, messaging, and cloud-related technologies from Microsoft. I myself has already registered for the event so hopefully will see you there. 😉

Tags: , , , , , ,

VBScript to PowerShell Converter

Are you a VBScript guy trying to learn the new and cool way of doing stuff in PowerShell? Does it seem that everything is different now and you have to lookup the docs each time you want to do something you have been doing for ages?

Fear not! Finally there’s a tool which does VBScript to PowerShell conversions for you. You type in the VBScript expression and it gets automatically converted into the PowerShell equivalent.

Automated VBscript to PowerShell conversion

As you can see we have just added this functionality into the PowerGUI Script Editor. All you need to do is press Ctrl-B (or find VBScript in full list of Ctrl-I and find VBScript category there).

Once you select the construct you need and hit Enter, the corresponding PowerShell code gets added to your script.

The functionality is available in the latest update to PowerGUI – version 1.0.15 – which you can download from our community site.

Tags: , , , , ,

PowerShell vs VBScript Survey

During the recent PowerShell security discussion Rod linked to this interesting scripting survey which he has set up.

Although PowerShell is obviously not even close to VBScript in popularity, according to this survey it already holds 3rd place as “most favorite scripting language” and is almost on the same level as Batch.

This is a fairly good result for the technology which has not yet become available out of the box in Windows! Would be interesting to repeat the survey in a couple of years. Any bets? 😉

AD cmdlets and domain statistics

So for all those who still does not believe PowerShell is taking manageability to a new level 😉 here’s a quick test: can you get basic statistics from your environment using “legacy” technologies such as VBScrip, WMI, ADSI, etc.? Here’s the list of “stuff” you might want to get: number of users, number of locations your company has (and their list), number of departments (and the list), titles, groups, etc. – the list can go on and on – I think you get the idea. Anyone?

With PowerShell you can do that with literally one line commands! And I’ve got an email from one of AD cmdlets team members – Andrei Polevoi – today with some cool examples of how he was using PowerShell to get the info.

Number of users:
PS C:\> (get-QADUser).count

List all departments:
PS C:\> get-qaduser -department * -sl 50000 | select Department | sort -property Department | Get-Unique -asstring

Get number of departments:
PS C:\> $dpts = get-qaduser -department * -sl 50000 | select Department | sort -property Department | Get-Unique -asstring
PS C:\> $dpts.count

PS C:\> $all_cities = get-qaduser -city * -sl 50000 | select City | sort -property City | Get-Unique -asstring
PS C:\> $all_cities.count

PS C:\> $all_titles = get-qaduser -Title * -sl 5000 | select Title | sort -property Title | Get-Unique -asstring
PS C:\> $all_titles.count

PS C:\> (get-qadgroup).count

I bet your VBScripts were slightly more complex? 😉

PowerShell just brings AD manageability to the whole new level!

My Recent Tweets


The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

May 2022

%d bloggers like this: