powershell

PowerShell and XenDesktop at the UK PowerShell UserGroup - 4th July 2012

I’ll be presenting tonight for the UK PowerShell UserGroup on using PowerShell to administer your XenDesktop environment. I’ll be providing some info on how the management of XenDesktop is built on top of PowerShell and how to get started using it. Details from Richard’s site below: Reminder–UK PowerShell UserGroup–July 2012 meeting When: Wednesday, Jul 4, 2012 8:30 PM (BST) Where: Virtual *~*~*~*~*~*~*~*~*~* Jonathan Medd will be talking about using PowerShell to administer a XenDesktop environment

Automating the Install of XenDesktop DDC with PowerShell

I had a need to automate the installation of Citrix XenDesktop DDC including using some of the different available install options. XenDesktopServerSetup.exe is the command line tool to use. Running XenDesktopServerSetup.exe /? displays most of the options that can be used, however I found a couple missing which are documented here. The Install-XenDesktopDDC function below will enable you to install XenDesktop with different options. For instance, to install all components, but no SQL Express and see the install steps:

Quick and Easy PowerShell Test-XMLFile

The PowerShell community extensions module contains Test-XML which can perform a number of checks for the validity of an XML file. For my particular needs I wasn’t able to take a dependency on an external module, consequently I needed to make something similar of my own to carry out some basic tests. The below function makes use of the XmlException exception from the XmlDocument class . An attempt is made to load the XML file and then any Load or Parse errors are caught by the XmlException exception.

PowerShell Quick Tip: Converting a String to a Boolean Value

Some PowerShell cmdlets include switch parameters, i.e. no arguments are typically supplied to them - they are either True / On when they are present and False / Off when they are not. However, it is also possible to explicitly specify them with $true and $false, e.g. -switchparameter:$true or -switchparameter:$false Typically you would not use this when working manually at the console, but what if you needed to automate a task using a switch parameter and set it to be On or Off based on values from a CSV or XML file, i.

Quick Tip on the PowerShell -match Operator

Here’s a quick tip for you when using PowerShell’s -match operator. The other day I was given a script to work on which was producing some (to the naked eye) confusing results, turned out the behaviour was actually consistent when you figured out what was happening. Here’s an example: Take the following text and store it in two variables: $a = "This is some text. It includes (brackets)" $b = "This is some text.

The Importance of Being On Time

In an Active Directory environment its typical for client machines to use a local domain controller as their time source, domain controllers with the PDC emulator for the domain and the PDC emulator for the root domain to synchronise time with an external source. In most circumstances the aim is to keep the time synchronised within a 5 minute tolerance level, this will ensure there are no issues with Kerberos authentication which has the 5 minute tolerance as part of its requirements.

Windows Server 8 Beta - Installing the first DC in a Forest on Server Core

Reminder: this post is based around a beta version of a product and obviously subject to changes before RTM. The release of Windows Server 8 Beta coincided with the need to build out a new homelab environment. I decided it would be a good opportunity to see how far I could use the Server Core deployment option (which is now the preferred choice in the install) and what issues I would come up against.

ESXi Syslog Server Check Plugin for vCheck6

I remember back to a London VMUG long ago a presentation about differences to watch out for between ESX and ESXi during the version 3.5 days. The one that got most people looking around at each other saying “oops, I don’t think we knew that” was configuring a Syslog server for your ESXi servers. vCenter 5 now includes it’s own built in Syslog server so there’s no excuse. Alternatives, such as Kiwi Syslog Server, are available if you don’t want to use the vCenter 5 syslog server.

Managing vCenter Plugins with PowerCLI

VMUG, vBeers, vLunch….whatever the occasion, there are always some great conversations and I particularly enjoy finding out what other people are up to in their environments. During vLunch last week, I was talking with Ed Grigson and he asked whether it was possible to use PowerCLI to remove vCenter Plugins that have got into an orphaned state, i.e. the uninstall process did not remove the vCenter plugin. VMware KB article 1025360 details a process whereby you can clean these up by navigating to the vCenter Server with a web browser.

WMI Class Win32_OperatingSystem Caption Property May Contain a Trailing Space

The WMI Class Win32_OperatingSystem Caption property returns the particular version of Windows, e.g.: Microsoft Windows Server 2008 R2 Enterprise or Microsoft(R) Windows(R) Server 2003, Enterprise Edition I had a requirement when querying this via PowerShell to take different actions based on whether the OS was some flavour of 2003 or 2008 and was using the following switch statement : switch ($OperatingSystem.Caption) { "Microsoft Windows Server 2008 R2 Enterprise" {$OSBuild = "2008"; break} "Microsoft(R) Windows(R) Server 2003, Enterprise Edition" {$OSBuild = "2003"; break} "Microsoft(R) Windows(R) Server 2003, Standard Edition" {$OSBuild = "2003"; break} default {$OSBuild = "Unknown"} } However, when querying a 2008 R2 server $OperatingSystem.