Remko Weijnen's Blog (Remko's Blog)

About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like

Get Actual CPU Clock Speed with PowerShell

To get the best performance out of Virtual Desktops it is essential that the power configuration in the system BIOS and the HyperVisor are configured for maximum performance.

Many people have blogged about the importance of these settings like, Andrew Wood, Helge Klein and Didier Van Hoye. So I will not go into details again.

But how do you check from a Virtual Machine if you are actually running at full clock speed or not?

I have written a PowerShell script to do just that (requires at least PowerShell v3).

Here are some screenshots:

Running with "High Performance profile":

CPU Clock Speed with d"High Performanced" Power Profile

Running with "Balanced" power profile:

CPU Clock Speed with High Performance Balanced Profile

(more…)

  • 2 Comments
  • Filed under: PowerShell
  • Scriptable Citrix Password Encoder

    A while ago I published a tool to Encode and Decode Citrix passwords. Today I am publishing a small update to this tool that makes it scriptable by adding a COM interface.

    If you start the tool without parameters you will get the GUI, just like before:

    Encrypt | Decrypt Password | Hash | Citrix | Ctx1

    To use the COM interface you first need to register the executable with the /regserver switch:

    CtxPass /RegServer

    After the registration you can call it using any language that supports COM. To get you started I wrote a few examples

    (more…)

    Parse RES Building Blocks with PowerShell

    Background
    Customer uses Citrix XenApp 5 with ThinApp, RES Workspace Manager and RES Workspace Extender.

    An application integration strategy is defined, the picture below displays the strategy and preferred order:

    image

    Question
    Customer wanted to know the type (1..7) for all applications currently defined in RES Workspace Manager.

    I decided to export all the Applications from RES WM as Building Blocks. This results in a folder with XML files. I decided to parse the XML files with a PowerShell script.

    (more…)

  • 0 Comments
  • Filed under: PowerShell, RES
  • A customer had partially implemented a (written) policy in the past where the the Local Administrator account was renamed according to a special convention.

    This policy stated that the Administrator account needed to be renamed to admin with the computername as a prefix.

    However they didn’t know exactly on which machines this policy had been applied to in the past. I was asked to write a script that would check a list of machine names, query the Administrator account name and write this in a new list.

    The Administrator account has a Well Known SID of S-1-5-21-xxxxxxx-500 where xxxxxxx is the SID of the computer.

    (more…)

  • 0 Comments
  • Filed under: PowerShell
  • Bit Shifting in PowerShell

    I needed to dome some Bit Shifting in PowerShell but unfortunately PowerShell lacks operator for Bit Shifting. I searched the .NET Framework for anything that allows for bit shifting but was unable to find anything suitable.

    I didn’t want to revert to C# so I implemented shift left and shift right functions in PowerShell.

    The code isn’t really pretty and could probably be improved (comments/improvements are welcome!) but here goes (please note that I implemented for bit shifting a byte):

    (more…)

  • 3 Comments
  • Filed under: PowerShell
  • Today I was troubleshooting a message that appeared when a user tries to edit a document from SharePoint on a Citrix XenApp server.

    The user browsed to a word document on Sharepoint and selected “Edit in Microsoft Office Word” from the Combobox:

    Edit in Microsoft Office Word

    This would present the following error message to the user:

    'Edit Document' requires a Windows SharePoint Services-compatible application and Microsoft Internet Explorer 6.0 or greater.

    (more…)

    From a script I needed to schedule a project in RES Automation Manager 2011 for a particular server.

    imageThis can be done with the WMC.exe commandline tool as documented in the Admin Guide. However we must specify the agent’s GUID instead of it’s name. We can of course use the AM console to get the agent’s GUID but it’s more flexible to script this.

    imageUnfortunately there’s no API we can call so I am directly quering the AM database using a PowerShell script.

    The script read the database server and database name from the registry so it assumes you have the AM console installed.

    (more…)

  • 0 Comments
  • Filed under: PowerShell, RES
  • PowerShell RegEx Fun

    I am writing a script that is going to automate a number of manual steps involved in creating a new image with Citrix PVS.

    First step is to copy the most recent base image which is kept in a folder structure. The folder name is always YYYY-MM-DD (description):

    image

    I needed to determine the most recent folder and didn’t want to rely on creation date. Instead I walk the directory tree and filter the date out of the filename with a regular expression:

    (more…)

  • 0 Comments
  • Filed under: PowerShell
  • Convert MCli output into PowerShell Objects

    imageI was experimenting today with the PowerShell cmdlets for Citrix Provisioning Server. I was surprised to learn that the output of these cmdlets are not PowerShell types such as collections and objects with methods and properties but just plain text output.

    A google search for a method to quickly convert the garbage output to objects led me to this blog post by Frank Peter. He describes a clever use of the switch statement with regular expressions with the Get-DiskInfo cmdlet.

    Using Frank’s code as a basis I wrote a generic function that converts Mcli output to an array of objects.

    (more…)

    Read Maximum Password Age with PowerShell

    imageI needed to read out the Maximum Password age with a PowerShell script in a Windows 2003 domain.

    Reading out the maxPwdAge attribute is a trivial task  in PowerShell (I am re-using the function AdsLargeIntegerToInt64):

    In my case this returns the value -78624000000000 but how do we interpret this?

    (more…)

    Blogroll


    Categories


    Archives