Sticky Notes on Windows 2008 R2 with RES Workspace Manager

In Windows 7 Sticky Notes is a standaard accessory. Strangely enough Sticky Notes is not an application on Windows 2008 R2.

When browsing the net I came along a site (link) how to make Sticky Notes available. (with the binaries from Windows 7).

After the installation of Sticky Notes on a Windows 2008 R2 server, when a user will start the application, a security message is shown.

ST_error_01

To remove this message the “StikyNot.exe” needs to be edited, so that NTFS file information is removed. The tool to use is “Steams.exe” which can be downloaded from sysinternals/Microsoft.

Starting the modified exe will start Sticky Notes without the security warning.

An other issue with this “port” of Stiky Notes is that is “installed” on another location than in Windows 7. “C:Program FilesSticky Notes” on Windows 2008 R2 and “%windir%system32″ on Windows 7.

Luckily the user is using RES Workspac Manager to manange the Workspace. I modified the application for Sticky Notes at the command line “%ST_PATH%StikyNot.exe“.
The Environment Variable is created on the Configuration option of the application and its value is changed depending on the OS it’s started. In the case of this RES WM implementation the appropiate Workspace container is used.

One big advantage is that for both OS’s the User Preferences are the same independant on which OS the user start the application.

ST_App_01

ST_App_02

ST_App_03

 

Running “XA65_Inventory_V31.PS1″ with a non English version of office.

When running Carl’s exelent “XA65_inventory_V31.PS1” script I encountered an error.

xa65_inv_error_NL_00

It appears, when running the script with an non English installation of Office / Word 2010 (in my case Dutch) the script will fail.

With the localized version of Office, Microsoft has  also localized the names of the Templates and the names of the styles within these templates.

What needs to be achieved is getting the English templates available in Office / Word 2010.

This can be done by installing the “Microsoft Office Single Language Pack – English”  Office 2010 Proofing tools English.exe. This language pack can be obtained (paid) by Microsoft: http://www.microsoftstore.com/store/msusa/en_US/pdp/productID.253665800

Office Language installer 01Office Language installer 02

When the installer is finished, (re-)start Word and go to Options, Language. (These menu items are still represented in your initial language).

Choose “editing Languages” “English (U.S.)” and set as Default.

Office Language settings 01

Choose “Display and help languages” “English” and make this choice Default.

Office Language settings 02

When clicking “OK” you are asked to restart Office (Word) (when this doesn’t work logoff and back on again).

Office Language settings 03

When Word is started the English language will be shown.

Word 2010 EN 01

Also the “Styles” are changed to “Normal”, “Heading 1″ …

Word 2010 EN 02

When running the script no errors are shown, now all the object of Word can be created.

Note: When starting Word for the first time, in the profile folder of the current user, a sub-folder “1033” in  “%AppData%MicrosoftDocument Building Blocks” will be created.  “1033” is the language code for English – United States.

 

Powershell Add-PSSnapin slow in RES Automation Manager

When I tried to schedule an simple PowerShell script [See script below], as a module in RES Automation Manager 2012 on a Windows 2008R2 machine, the task took a very long time to finish (+/- 2 min.)

[sourcecode language="powershell"]
Add-PSSnapin Citrix.XenApp.Commands
$server = get-content env:computername
Disable-XAServerLogOn $server
[/sourcecode]

Note: Script disables the logon to a XenApp server.

When I opened a PowerShell console on the Windows 2008R2 machine and ran the script, I found that the delay was caused by the “Add-PSSnapin” cmd-let. It appears that during this command the Snap-ins has to verify the certificate of the Snap-In online. The User in the security context of the task didn’t has access to the internet and because of this the check times-out and caused the delay.

Solution to this behavior is disabling the certificate check against the Certificate Revocation List. A way to do this is changing the value “State” at [HKCU:SoftwareMicrosoftWindowsCurrentVersion WinTrustTrust ProvidersSoftware Publishing] to “146944″ (decimal).

I made an other PowerShel task, with the same user in the security context, to modify the above setting in the profile of this user.

[sourcecode language="powershell"]
set-ItemProperty -path "HKCU:SoftwareMicrosoftWindowsCurrentVersionWinTrustTrust ProvidersSoftware Publishing" -name State -value 146944
[/sourcecode]

After this modification of the duration of the task was reduced from +/- 2 min. to 2 a 3 sec.

 

Update: 030613:  RES Support made an article about this.

 

Delete multiple XenServer orphan SR’s

When a Citrix XenServer, member of a Resource Pool, is reinstalled the local storage repositories (Local storage, DVD drive) are left in the resource pool as orphans. In XenCenter, below a Resource Pool, these SR’s are marked with a red bullet.

When there are a few of these orphaned SR, you can remove these with the console command:

Note uuid of the SR’s with:

To delete this SR:

But what to do if there are to much of the orphaned SR’s ? The procedure above is very time-consuming.

Lets see if Powershell can help solve this problem. For XenServer, as for other Citrix products, are Powershell cmd-lets available. With the help from this Pdf I found the cmd-let to get the SR list.

The command let to get a list of all the SR’s is:

I had to find out which property of the SR’s is one of the orphaned SR’s… It appears that an orphaned SR has no PBD’s assigned. Because this property is returned as an array I need a way to determine a way to check this. When an array is empty teh array count is “0″.

Now we have al the UUID os the orpahned SR’s. To delete a SR in Powershell:

Combined in a script, with all the logic and cmd-lets check, will result in:

 

 

Script Convert-ExcelSerialdate

When converting an Excel sheet, containing a column with dates, to a CSV file, the column in the CSV file contains nummeric values instead of date values. These numeric values are Serial dateformated values, used internal by Excel to calculate the date.

More info: Link

I wrote a Powershell function to convert the Excle serial date to a .Net date object:

Example code