Archive for April, 2007

SharePoint Management Trials on a Virtual Machine Image

This was a big week for us: for the first time ever Quest Software is offering trial versions of its product as virtual machine images.

That means that if you are interested in SharePoint management, reporting, or item-level recovery you can simply download the trial virtual machine image that has both SharePoint and the tools deployed for you and just open the image with Virtual Server, VMWare player, or your other favorite virtualization software.

We believe that this provides a much better evaluation experience: significantly easier than making you deploy a test lab yourself (or try new software in production!) and much more true-to-life than flash demos.

The current images are pretty big but we plan of making them smaller in the future. If this approach proves to be a success (which I am sure it will) in a few years you’ll see all our products having virtual machine sandboxes as the primary method of trial version distribution.

Virtual machine appliances are not that widely spread in the Windows world today but I believe that this is starting to change.

If you want to read about how this project emerged and why it took us so long to get here I would recommend reading this ComputerWorld article: Microsoft offers a peak at software distribution future.

P.S. Just found that Volker from Microsoft’s VHD team blogged about that as well. Volker did a lot to make this happen. Big kudos to him and his team!

Tags: , , , , , , ,

Austin’s DEC PowerShell Dinner Pictures

Austin has just started uploading some of the pictures he took at DEC last week to his Flickr stream. This is a useful source of visual information of who is who in the PowerShell world (unfortunately not comprehensive because not everyone made it to the conference).

Scotty, Deji, me, onion rings, and Richard

Scotty, Dung, me, onion rings, and Richard

Robert and Rene from PowerGadgets

Robert and Rene from PowerGadgets

Rolf, Austin, his wife, and fragments of other guys

Rolf, Austin, his wife, and fragments of other guys

Rene, Alex’s hand, Shawn, and Jackson

Rene, Alex’s hand, Shawn, and Jackson

Here’s the entrire feed (including shots from the conference itself so you know it was not all just dinner.)

Anyway, this was a great show for PowerShell and a really nice dinner (PowerShell bus was incredibly cool!)

Was good to finally meet a lot of the guys face to face!

Tags: , , , , , ,

Enable User Accounts with PowerShell

Question: How to enable AD user account using Windows PowerShell cmdlets?

Answer (shamelessly stolen from Andrei’s post in the PowerGUI discussion forum):

1. [If this is a new account] Create the account using New-QADUser. Make sure the password is also set (-UserPassword parameter)

2. Enable the account by setting userAccountControl to 512: e.g.

Set-QADUser TEST\testuser -ObjectAttributes @{userAccountControl=512}

Bulk account provisioning: 

If you want to do that in bulk using csv file for bulk user account provisioning this might (depending on the columns in your file and attributes being set) look like:

PS C:\> Import-Csv users.csv | ForEach-Object {New-QADUser -ou acme.local/demo -name $_.Name -UserPassword $_.Password

PS C:\> Import-Csv users.csv | ForEach-Object {Set-QADUser $_.Name -ObjectAttributes @{userAccountControl=512}}

Due to AD cmdlets not having a community site of their own we have created a forum for Active Directory PowerShell discussions on Andrei and other members of his team are there for your questions, feature requests, etc.

Tags: , , , ,

AD provider vs. AD cmdlets

Richard has interesting considerations in his blog about AD provider potentially being too dangerous as its use might be error-prone, so someone could type del * without understanding the current context and thus the consequences.

When we started working on our AD cmdlets we surely had a lot of discussions of the approach to take: cmdlets or provider. Frankly, we didn’t think of this danger of inadvertent AD changes that Richard mentions. We picked cmdlets as a way to give administrators more intuitive and functional commands to accomplish their tasks.

You see if you want add an account to a group it is probably more natural for you to type something like: add-groupmember than to use file-system metaphor for this not file-system-related task. Cmdlets also make the functionality more discoverable with tab-completion letting you easily see what parameters are available for that particular command on that particular object.

Does this mean that cmdlets are always a better choice though?

I am not sure really. I still think that being able to use the provider to browse AD, cd into OUs, dir their contents, etc. – is very impressive and in fact highly intuitive.

I guess bottom-line is that it is great that both projects exist and both are available as free downloads.

In his DEC session by the way Richard demoed how you can use those together piping out provider output into AD cmdlets. That was pretty cool. Richard promised to publish his demo transcript in his blog later on – if you could not attend his DEC session make sure you grab the transcript once it gets published.

Tags: , , , , , , ,

PowerGUI 1.0.5 is out!

We have just released version 1.0.5 of PowerGUI. You can get it free from the PowerGUI community web site and no registration is required.

Most new features and fixes are listed on the roadmap page.

Some of them are minor improvements which will hopefully make everyone’s life easier: the Actions pane is open by default, most commands are duplicated on the toolbar, setup has the latest packs for network management, Exchange (with UI for certificate management!) and Operations Manager, etc.

We’ve made a few improvements in the architecture as well. The biggest is asynchronous work with PowerShell so PowerGUI no longer waits for all objects to be retrieved before it starts displaying you what it got.

We have also moved to a new setup which should have less issues than the Visual Studio one we used before (it might require you to uninstall 1.0.4 though – but will preserve all you settings during the upgrade anyway.)

One gotcha that I want to mention is that 1.0.5 checks whether PowerShell Community Extensions are installed and if it detects version 1.1 or earlier would not let you install PowerGUI. We had to do this due to the incompatibility issues the extensions had.

If you do use the extensions there’s a workaround to that check:

1. Comment out the extensions’ lines in the PowerShell profile which cause the issue:

lines 98 and 138 in your profile.ps1:

(line 98)
# Start-TabExpansion

(line 138)
# . '.\TabExpansion.ps1'

the ‘#’ prevents the line from executing when powershell/powergui starts up.

2. Download the PowerGUI 1.0.5 setup from and run the file from the command-line using the following command:

msiexec.exe /i PowerGUI. IGNOREPSCX=1

Thanks to Austin for locating the issue and suggesting the workaround! Austin, please redownload the setup and use the command above!

Tags: , , , , , , , , , ,

PowerShell Script for Mailbox Provisioning

Yesterday I posted a blogcast on PowerShell-based mailbox provisioning.

Below is the script which PowerGUI executes when you click that Create from CSV file action.

What I am doing in the script is basically:

1. Prompt for the file name (param).

2. Read into into an array.

3. Check whether columns with mandatory parameters are in the file.

4. And then just go column by column constructing the new-mailbox command for each row.

5. If Password column is not present I use UPN instead (you can change to your own rule).

6. Finally, I just call Invoke-Expression for all these generated commands.

Of course in PowerGUI all you need to do is just click a button, but for all PowerShell geeks out there here’s the code:


[array]$csv = import-csv $file

# This script implies that columns "UserPrincipalName", "name",

# "database","OrganizationalUnit" exist in the csv file

if (($csv[0].UserPrincipalName -eq $null) -or ($csv[0].Name -eq $null) -or ($csv[0].Database -eq $null) -or ($csv[0].OrganizationalUnit -eq $null) ) {throw "Parameter missing... Make sure the CSV file has the following columns: UserPrincipalName, Name, Database, OrganizationalUnit."}

# Create collection of the commands that we will invoke in the end
[collections.arraylist]$Commands=new-object system.collections.arraylist

for($i=0; $i -lt $csv.Count; $i++)

[void]$Commands.Add("new-mailbox -UserPrincipalName `"$($csv[$i].UserPrincipalName)`" -Name `"$($csv[$i].Name)`" -Database `"$($csv[$i].Database)`" -OrganizationalUnit `"$($csv[$i].OrganizationalUnit)`"" + ' -Password $pwd ')

# Add other parameters if present in the CSV

if ($csv[0].Alias -ne $null) {
for($i=0; $i -lt $csv.Count; $i++)
  $Commands[$i] = $Commands[$i] + " -Alias `"$($csv[$i].Alias)`""

if ($csv[0].DisplayName -ne $null) {
for($i=0; $i -lt $csv.Count; $i++)
$Commands[$i] = $Commands[$i] + " -DisplayName `"$($csv[$i].DisplayName)`""

if ($csv[0].FirstName -ne $null) {
for($i=0; $i -lt $csv.Count; $i++)
$Commands[$i] = $Commands[$i] + " -FirstName `"$($csv[$i].FirstName)`""

if ($csv[0].LastName -ne $null) {
for($i=0; $i -lt $csv.Count; $i++)
$Commands[$i] = $Commands[$i] + " -LastName `"$($csv[$i].LastName)`""

if ($csv[0].Initials -ne $null) {
for($i=0; $i -lt $csv.Count; $i++)
$Commands[$i] = $Commands[$i] + " -Initials `"$($csv[$i].Initials)`""

if ($csv[0].SamAccountName -ne $null) {
for($i=0; $i -lt $csv.Count; $i++)
$Commands[$i] = $Commands[$i] + " -SamAccountName `"$($csv[$i].SamAccountName)`""

for($i=0; $i -lt $csv.Count; $i++)
$pwd = new-object Security.SecureString

if ($csv[0].Password -ne $null) {
$csv[$i].Password.ToCharArray() | foreach { $pwd.AppendChar($_) }
} else {
$csv[$i].UserPrincipalName.ToCharArray() | foreach { $pwd.AppendChar($_)


Invoke-Expression $Commands[$i]

Tags: , , , , ,

Provision Exchange Mailboxes from CSV

Wouldn’t it be great to pick a few mailboxes, export their properties to Excel, make a few changes, and use that changed file to provision a bunch of new user accounts and mailboxes? PowerGUI comes with commands to do that!

PowerGUI gives you user interface for a lot of actions which used to require scripting. While I am striving to find time at DEC to finish editing my webcast, so I thought I’ll do a few blogcasts (is there such a word already?) now instead.

Here we go:

1. Download and install PowerGUI on a computer which has either Exchange 2007 or its management tools.

2. Click Mailboxes, make sure that the following columns are displayed (right-click the header to add the columns): UserPrincipalName, Name, Database, OrganizationalUnit – these are mandatory for new Exchange mailboxes.

3. Select the mailboxes you want to export and click Report as CSV:

Select sample mailboxes for provisioning

4. Specify the filename for the output (e.g. c:\test.csv) and click OK. The file will open in whatever is your CSV edit. Normally it should be Excel- in my case the machine didn’t have Office so I had to use Notepad:

Change propeties

5. Change the properties as you wish for the new mailboxes (in my case I just did Replace All), add new rows, add a column Password and set passwords for the new accounts (otherwise we’ll just use UPN for that).

6. Save the file.

7. In PowerGUI click Create new from CSV action.

Create from CSV

8. Type in the file path and click OK.

Select CSV file

9. That’s it – the new accounts and mailboxes got provisioned!

New mailboxes are there!

If you want to schedule provisioning to happen on regular basis (e.g. nightly) just go to the PowerShell Code tab and use the code there for your script.

PowerShell and PowerGUI rock! 😉

Tags: , , , , , ,

Exchange 2007 PowerPack: UI on top of PowerShell

Exchange 2007 is one of the most PowerShell’ized Microsoft platforms. PowerGUI reuses that to provides graphical interface for bulk property changes, mailbox provisioning from csv files, public folder- and certificate management.

I’ve just uploaded to PowerGUI library a pack for Exchange 2007 that does all of the above and much more.

PowerGUI had a built-in pack for managing Exchange 2007 for a long time. However, the trick has been that the pack only showed up when PowerGUI was installed on a computer which already had either Exchange or the management tools. Install the stuff in reverse order (PowerGUI first) and you have not Exchange pack in it. Now even in that case you can download the PowerShell-based Exchange pack separately and import it into PowerGUI.

I’ve also shot a webcast about the pack and will hopefully upload it to this week and will make a few blog posts on it contents.

P.S. Historically one of the reasons why we started the PowerGUI project was due to the fact that once we started using E12 (codename for Exchange 2007) beta we found that indeеhe UI (Exchange Management Console) was just a subset of the PowerShell command-line and the latter was the only option for a lot of management operations: public folders, certificates, etc. Luckily PowerShell was indeed available for all these operations and this pack gives you UI for all these operations.

Tags: , , , , , ,

PowerShell access to AD computed attributes

Richard Siddaway published a few examples of using AD cmdlets to access computed attributes in Active Directory.

In his examples Richard uses msDS-User-Account-Control-Computed to detect which accounts are locked out, have never been used, or are expired. This is pretty big as none of that is possible using just userAccountControl.

Tags: , , , ,

PowerShell at DEC next week

Let me know if you are at the Directory Experts Conference in Vegas next week – it will be a good place to get together and sync-up!

It looks like PowerShell is going to be pretty big on this DEC. On Tuesday Dung Hoang-Khac from HP will give a PowerShell introduction session which will then be followed by an AD-specific session by Richard Siddaway from UK PowerShell User Group (aka get-psukug). Danny Kim from Full Armor will also have PowerShell section in his presentation related to the GPO and workflow stuff they are doing. Pretty good representation of the technology for a directory conference!

More importantly on Tuesday night everyone mentioned above as well as a few more guys from the UK user group, Quest’s AD cmdlets team, and folks from PowerGadgets are planning to get together for a PowerShell dinner.

If you are at the conference and you are a part of the PowerShell community maybe you should join the group. Send me an email or leave a comment with a way to get in touch with you (or find me at DEC) so I make sure we have a place reserved for you.

See you at DEC!


Tags: , , , , , , , , , ,

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

April 2007

%d bloggers like this: