$theTitle=wp_title(" - ", false); if($theTitle != "") { ?>
About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like
6 Mar // php the_time('Y') ?>
From a script I needed to schedule a project in RES Automation Manager 2011 for a particular server.
This 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.
Unfortunately 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.
6 Mar // php the_time('Y') ?>
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):
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:
29 Feb // php the_time('Y') ?>
I 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.
14 Feb // php the_time('Y') ?>
Just some quick code to get the OU Name of the computer we run the script on.
VBS:
1 2 3 4 5 6 7 8 | Function GetComputerOU Dim objSysInfo: Set objSysInfo = CreateObject("ADSystemInfo") Dim objComputer: Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName) Dim objOU : Set objOU = GetObject(objComputer.Parent) GetComputerOU = objOU.OU End Function Wscript.Echo GetComputerOU |
PowerShell:
1 2 3 4 5 6 7 8 | function GetComputerOU { $SysInfo = New-Object -ComObject "ADSystemInfo" $Computer = [ADSI]("LDAP://{0}" -f $SysInfo.GetType().InvokeMember("ComputerName", [System.Reflection.BindingFlags]::GetProperty, $null, $SysInfo, $null)) return ([ADSI]$Computer.Parent).OU } GetComputerOU |
13 Feb // php the_time('Y') ?>
The Citrix Online Plugin has a number of settings that can be changed. This includes things as Window Size and Color Depth:
In my case I wanted to preset the Window size to Full Screen so using Process Monitor I checked where the Online Plugin writes this setting. I Used a Filter that includes only the Online Plugin (PNAMain.exe) and the RegSetValue Operation:
16 Jan // php the_time('Y') ?>
After reading Andy Morgan’s (excellent) blog post about Removing Screen Resolution and Personalize shell extensions from a users desktop session I couldn’t help it.
I had to write a PowerShell script to take ownership of the mentioned registry keys. So here goes:
2 Dec // php the_time('Y') ?>
I 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):
1 2 3 4 | $domain = New-Object System.DirectoryServices.DirectoryEntry # Read maxPwdAge attribute and convert to Int64 $maxPwdAge = AdsLargeIntegerToIn64 $Domain.maxPwdAge.Value |
In my case this returns the value -78624000000000 but how do we interpret this?
2 Dec // php the_time('Y') ?>
I was creating a small dialog in an .hta file and to make a little prettier for the user I included a company logo:
But I wanted to deploy the .hta as a single file.
1 Dec // php the_time('Y') ?>
Some Active Directory attributes return an 8 byte integer in the form of an IADsLargeInteger interface. An example is the pwdLastSet attribute from a user object.
Because the IADsLargeInteger object doesn’t provide type information PowerShell cannot read the HighPart and LowPart properties.
So I wrote the function below to get the Int64 value of an IADsLargeInteger:
8 Nov // php the_time('Y') ?>
Today one of my collegues asked me to write a script that performs two actions for all users of a certain Organizational Unit:
Sounds like a PowerShell job right?
I reused my function to set NTFS Permissions by SID: