Welcome to MSDN Blogs Sign in | Join | Help

PowerShell tweaks for controlling Virtual Server

On Tuesday I talked about how to control Virtual Server from PowerShell.  Since then I have come up with a couple of simple tweaks to make interacting with Virtual Server easier.

  1. Load the interop DLL as part of your profile.

    You can create your own personal profile script that gets run for all PowerShell instances by creating the file 'profile.ps1' in a 'PSConfiguration' directory under your 'My Documents' folder.  I have created this and added the command to load the Virtual Server interop DLL: [System.Reflection.Assembly]::loadfrom("C:\Documents\PSConfiguration\VSWrapperForPSH.dll") > $null (note that I am redirecting to $null so I do not see any of the output each time).

  2. Create a script for setting COM security.

    I have created a script called 'SetSecurity.ps1' with the following contents:

        Param($object)
        [Microsoft.VirtualServer.Interop.PowerShell]::SetSecurity($object)

    Note that in order to run scripts you will need to 'set-executionpolicy' appropriately.

  3. If you are running Vista and need to run PowerShell as administrator - you can do this by manually creating a new shortcut and checking this option under the compatibility tab

With these three steps - interacting with Virtual Server is quite easy:

Virtual Server and PowerShell

Cheers,
Ben

Published Thursday, June 15, 2006 9:44 PM by Virtual PC Guy

Comments

Saturday, June 17, 2006 7:36 PM by VMblog.com - Virtualization Information

# CODE: PowerShell tweaks for controlling Virtual Server

If you've been keeping up with all the information going around about PowerShell, you should be interested in the latest information from Ben Armstrong.  

Previously, Ben discussed how to control Virtual Server from PowerShell since it isn't easy as
Wednesday, July 05, 2006 2:35 AM by Tim Mintner

# Use Powershell to add virtual machines to Virtual Server

Back to a topic that I know I won't get dinged on.  :)
I was playing arround with the list of available...
Tuesday, January 30, 2007 3:11 AM by Virtual PC Guy's WebLog

# Querying guest operating system information with Powershell

I recently posted how to query guest operating system information using VBScript . It was pointed out

Wednesday, January 31, 2007 2:27 AM by Virtual PC Guy's WebLog

# Listing virtual machines under Powershell

There are a lot of things you can do with Virtual Server and Powershell by just interacting with the

Thursday, February 01, 2007 2:39 AM by Virtual PC Guy's WebLog

# Examining Virtual Hard Disks through Powershell

OK, today I would like to try making a script to display virtual hard disk information under Powershell.

# Lead, Follow, or Move » Blog Archive » Get-PSUGUK July Meeting

# markwilson.it [formerly known as Mark's (we)Blog] » Controlling Virtual Server 2005 R2 using Windows PowerShell

New Comments to this post are disabled
 
Page view tracker