<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Script on Remko's Blog</title><link>https://remkoweijnen.nl/blog/categories/script/</link><description>Recent content in Script on Remko's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 19 Mar 2013 16:27:49 +0000</lastBuildDate><atom:link href="https://remkoweijnen.nl/blog/categories/script/index.xml" rel="self" type="application/rss+xml"/><item><title>Scriptable Citrix Password Encoder</title><link>https://remkoweijnen.nl/blog/2013/03/19/scriptable-citrix-password-encoder/</link><pubDate>Tue, 19 Mar 2013 16:27:49 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2013/03/19/scriptable-citrix-password-encoder/</guid><description>&lt;p&gt;A while ago I &lt;a href="https://remkoweijnen.nl/blog/2012/05/13/encoding-and-decoding-citrix-passwords/"&gt;published&lt;/a&gt; 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 &lt;a href="http://en.wikipedia.org/wiki/Component_Object_Model" target="_blank"&gt;COM interface&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;If you start the tool without parameters you will get the GUI, just like before:&lt;/p&gt; &lt;p&gt;&lt;img loading="lazy" decoding="async" title="Citrix Password Hasher by Remko Weijnen" alt="Encrypt | Decrypt Password | Hash | Citrix | Ctx1" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/05/image_thumb3.webp" width="419" height="84" /&gt;&lt;/p&gt; &lt;p&gt;To use the COM interface you first need to register the executable with the /regserver switch:&lt;/p&gt; &lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2013/03/SNAGHTML185eb4ec.webp" data-type="image" data-gallery="post-3152"&gt;&lt;img loading="lazy" decoding="async" style="display: inline" title="Register CtxPass" alt="CtxPass /RegServer" src="https://remkoweijnen.nl/blog/wp-content/uploads/2013/03/SNAGHTML185eb4ec_thumb.webp" width="414" height="64" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;After the registration you can call it using any language that supports COM. To get you started I wrote a few examples&lt;/p&gt;</description></item><item><title>MSCOMM32.OCX returns error 80040112</title><link>https://remkoweijnen.nl/blog/2013/03/13/mscomm32-ocx-returns-error-80040112/</link><pubDate>Wed, 13 Mar 2013 15:58:39 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2013/03/13/mscomm32-ocx-returns-error-80040112/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/2013/03/11/the-case-of-the-com-port-redirection/"&gt;Yesterday&lt;/a&gt; I wrote about troubleshooting an application that used Com Port redirection in Citrix.&lt;/p&gt; &lt;p&gt;During the troubleshoot I noticed that the application used an ActiveX component, MSCOMM32.OCX, for serial communication.&lt;/p&gt; &lt;p&gt;I wanted to quickly test if the component was correctly registered so I searched the registry from HKEY_CLASSES_ROOT for mscomm32.ocx.&lt;/p&gt;</description></item><item><title>Switching to the Services Session</title><link>https://remkoweijnen.nl/blog/2012/02/24/switching-to-the-services-session/</link><pubDate>Fri, 24 Feb 2012 14:49:21 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/02/24/switching-to-the-services-session/</guid><description>&lt;p&gt;Just read a tweet from &lt;a href="http://twitter.com/andyjmorgan" target="_blank"&gt;@andyjmorgan&lt;/a&gt; about &lt;a href="http://twitter.com/andyjmorgan/statuses/173033102514462720" target="_blank"&gt;Interactive Service Detection&lt;/a&gt;. This made me remember that it's possible to switch to the Session 0 with an undocumented api in winsta.dll.&lt;/p&gt; &lt;p&gt;For this API to work you must have the Interactive Services Detection (UI0Detect) service running.&lt;/p&gt;</description></item><item><title>Script to Get Computer OU</title><link>https://remkoweijnen.nl/blog/2012/02/14/script-to-get-computer-ou/</link><pubDate>Tue, 14 Feb 2012 11:12:30 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/02/14/script-to-get-computer-ou/</guid><description>&lt;p&gt;Just some quick code to get the OU Name of the computer we run the script on.&lt;/p&gt;
&lt;p&gt;VBS:&lt;/p&gt;
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;span class="codelang"&gt;vb.net&lt;/span&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".vb" href="data:text/plain;charset=utf-8;base64,RnVuY3Rpb24gR2V0Q29tcHV0ZXJPVQoJRGltIG9ialN5c0luZm86IFNldCBvYmpTeXNJbmZvID0gQ3JlYXRlT2JqZWN0KCJBRFN5c3RlbUluZm8iKQoJRGltIG9iakNvbXB1dGVyOiBTZXQgb2JqQ29tcHV0ZXIgPSBHZXRPYmplY3QoIkxEQVA6Ly8iICYgb2JqU3lzSW5mby5Db21wdXRlck5hbWUpCglEaW0gb2JqT1UgOiBTZXQgb2JqT1UgPSBHZXRPYmplY3Qob2JqQ29tcHV0ZXIuUGFyZW50KQoJR2V0Q29tcHV0ZXJPVSA9IG9iak9VLk9VCkVuZCBGdW5jdGlvbgoKV3NjcmlwdC5FY2hvIEdldENvbXB1dGVyT1U="&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;pre class="language-vbnet"&gt;&lt;code class="language-vbnet"&gt;Function GetComputerOU
	Dim objSysInfo: Set objSysInfo = CreateObject(&amp;#34;ADSystemInfo&amp;#34;)
	Dim objComputer: Set objComputer = GetObject(&amp;#34;LDAP://&amp;#34; &amp;amp; objSysInfo.ComputerName)
	Dim objOU : Set objOU = GetObject(objComputer.Parent)
	GetComputerOU = objOU.OU
End Function

Wscript.Echo GetComputerOU&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;PowerShell:&lt;/p&gt;</description></item><item><title>Get the location of an advertised shortcut</title><link>https://remkoweijnen.nl/blog/2012/01/18/get-the-location-of-an-advertised-shortcut/</link><pubDate>Wed, 18 Jan 2012 13:28:36 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/01/18/get-the-location-of-an-advertised-shortcut/</guid><description>&lt;p&gt;Installers can create so called Advertised Shortcuts in the Start Menu. I wanted to check the Target Path of such an shortcut but Explorer doesn&amp;rsquo;t show it:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/01/image13.webp" class="glightbox" data-type="image" data-gallery="post-2334"&gt;&lt;img loading="lazy" decoding="async" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="Microsoft Visio 2010 Properties" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/01/image_thumb13.webp" alt="Microsoft Visio 2010 Properties | Shortcut Properties | Target Path" width="233" height="317" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Citrix online plug-in received a corrupt ICA File</title><link>https://remkoweijnen.nl/blog/2011/12/13/citrix-online-plug-in-received-a-corrupt-ica-file/</link><pubDate>Tue, 13 Dec 2011 10:58:24 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/12/13/citrix-online-plug-in-received-a-corrupt-ica-file/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image4.webp" class="glightbox" data-type="image" data-gallery="post-2242"&gt;&lt;img loading="lazy" decoding="async" style="display: inline; float: left" title="image" alt="image" align="left" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image_thumb4.webp" width="38" height="35" /&gt;&lt;/a&gt;I was testing a Script I wrote to launch a Citrix XenApp session using the Ica Client Object. Typical code to do this may look like this:&lt;/p&gt; 
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;span class="codelang"&gt;vb.net&lt;/span&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".vb" href="data:text/plain;charset=utf-8;base64,Q29uc3QgY0h0dHBCcm93c2VyID0gInNvbWV1cmwubG9jYWwiCkNvbnN0IGNDb2xvckRlcHRoID0gNAoKJyBDcmVhdGUgdGhlIElDQSBDbGllbnQgT2JqZWN0CkRpbSBvYmpJY2EgOiBTZXQgb2JqSWNhID0gQ3JlYXRlT2JqZWN0KCJDaXRyaXguSWNhQ2xpZW50LjIiKQoKJyBTZXQgQ3JlZGVudGlhbHMKb2JqSWNhLlVzZXJuYW1lID0gIkpvaG5Eb2UiCm9iakljYS5TZXRQcm9wICJDbGVhclBhc3N3b3JkIiwgIlNlY3JldDAxIgpvYmpJY2EuRG9tYWluID0gIkNPTlRPU08iCgonIENvbm5lY3Rpb24gU2V0dGluZ3MKb2JqSWNhLkJyb3dzZXJQcm90b2NvbCA9ICJIVFRQb25UQ1AiCm9iakljYS5UcmFuc3BvcnRSZWNvbm5lY3RFbmFibGVkID0gVHJ1ZQpvYmpJY2EuSHR0cEJyb3dzZXJBZGRyZXNzID0gY0h0dHBCcm93c2VyCgonIFNlc3Npb24gU2V0dGluZ3MKb2JqSWNhLkFkZHJlc3MgPSAiTXlBcHAiCm9iakljYS5BcHBsaWNhdGlvbiA9ICJNeUFwcCIKb2JqSWNhLkRlc2lyZWRDb2xvciA9IGNDb2xvckRlcHRoCm9iakljYS5TY3JlZW5QZXJjZW50ID0gMCAnIEZ1bGwgU2NyZWVuCm9iakljYS5EZXNpcmVkSFJlcyA9IDAKb2JqSWNhLkRlc2lyZWRWUmVzID0gMApvYmpJY2EuTGF1bmNoID0gVHJ1ZQoKJyBDb25uZWN0Cm9iakljYS5Db25uZWN0"&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;pre class="language-vbnet"&gt;&lt;code class="language-vbnet"&gt;Const cHttpBrowser = &amp;#34;someurl.local&amp;#34;
Const cColorDepth = 4

&amp;#39; Create the ICA Client Object
Dim objIca : Set objIca = CreateObject(&amp;#34;Citrix.IcaClient.2&amp;#34;)

&amp;#39; Set Credentials
objIca.Username = &amp;#34;JohnDoe&amp;#34;
objIca.SetProp &amp;#34;ClearPassword&amp;#34;, &amp;#34;Secret01&amp;#34;
objIca.Domain = &amp;#34;CONTOSO&amp;#34;

&amp;#39; Connection Settings
objIca.BrowserProtocol = &amp;#34;HTTPonTCP&amp;#34;
objIca.TransportReconnectEnabled = True
objIca.HttpBrowserAddress = cHttpBrowser

&amp;#39; Session Settings
objIca.Address = &amp;#34;MyApp&amp;#34;
objIca.Application = &amp;#34;MyApp&amp;#34;
objIca.DesiredColor = cColorDepth
objIca.ScreenPercent = 0 &amp;#39; Full Screen
objIca.DesiredHRes = 0
objIca.DesiredVRes = 0
objIca.Launch = True

&amp;#39; Connect
objIca.Connect&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On my testmachine it ran nicely but on a customer machine the script failed with the error 2312 "&lt;em&gt;The Citrix online plug-in received a corrupt ICA File. The ICA File has no [ApplicationServer] section&lt;/em&gt;":&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/SNAGHTML108b7fef.webp" class="glightbox" data-type="image" data-gallery="post-2242"&gt;&lt;img loading="lazy" decoding="async" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Error number 2312" border="0" alt="The Citrix online plug-in received a corrupt ICA File. The ICA File has no [ApplicationServer] section" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/SNAGHTML108b7fef_thumb.webp" width="419" height="98" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Embedding images in HTML</title><link>https://remkoweijnen.nl/blog/2011/12/02/embedding-images-in-html/</link><pubDate>Fri, 02 Dec 2011 13:09:43 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/12/02/embedding-images-in-html/</guid><description>&lt;p&gt;I was creating a small dialog in an &lt;a href="http://en.wikipedia.org/wiki/HTML_Application" target="_blank"&gt;.hta file&lt;/a&gt; and to make a little prettier for the user I included a company logo:&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/SNAGHTMLdfa805.webp" class="glightbox" data-type="image" data-gallery="post-2209"&gt;&lt;img loading="lazy" decoding="async" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SNAGHTMLdfa805" border="0" alt="SNAGHTMLdfa805" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/SNAGHTMLdfa805_thumb.webp" width="270" height="206" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;But I wanted to deploy the .hta as a single file.&lt;/p&gt;</description></item><item><title>Remote Registry from 32 to 64 bit</title><link>https://remkoweijnen.nl/blog/2011/10/21/remote-registry-from-32-to-64-bit/</link><pubDate>Fri, 21 Oct 2011 09:05:11 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/10/21/remote-registry-from-32-to-64-bit/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/10/image5.webp" class="glightbox" data-type="image" data-gallery="post-2146"&gt;&lt;img loading="lazy" decoding="async" style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/10/image_thumb5.webp" width="40" height="38" /&gt;&lt;/a&gt;Yesterday I needed to set a few registry keys remotely from a 32 bit windows machine to a 64 bit machine.&lt;/p&gt; &lt;p&gt;I used reg.exe to set the key but even though it returned success the key wasn't altered.&lt;/p&gt; &lt;p&gt;As I suspected the key was written to the Wow6432Node. In the help I couldn't find any switch to force reg.exe to use the 64-bit view.&lt;/p&gt; &lt;p&gt;On a 64 bit machine this is not a problem since both 32- and 64 bit versions of reg.exe exists. The 32 bit version of reg.exe defaults to the 32 bit view and the 64 bit version defaults to the 64 bit view.&lt;/p&gt; &lt;p&gt;But luckily reg.exe has a switch (that is not listed in the help) to force the View:&lt;/p&gt; &lt;ul&gt;</description></item><item><title>Apply IP Configuration from a Database</title><link>https://remkoweijnen.nl/blog/2011/04/29/apply-ip-configuration-from-a-database/</link><pubDate>Fri, 29 Apr 2011 10:27:27 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/04/29/apply-ip-configuration-from-a-database/</guid><description>&lt;p&gt;I am currently deploying 64 Citrix XenApp servers with Altiris. The deployment consists of an OS Image, OS Configuration and finally Citrix XenApp and Applications.&lt;/p&gt;
&lt;p&gt;In the OS Configuration part the IP configuration needs to be applied and I decided to do this with a database.&lt;/p&gt;
&lt;p&gt;The database consists of 2 tables; one table with the per host settings and one table with the global settings (such as DNS).&lt;/p&gt;
&lt;p&gt;In the Altiris job both tables are read from an embedded VBScript and assigned to the NIC.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;Database configuration&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I created a database (SQL Server) called IPManagement with 2 tables:&lt;/p&gt;
&lt;p&gt;&lt;a class="glightbox" data-type="image" data-gallery="post-1695" href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/04/image7.webp"&gt;&lt;img loading="lazy" decoding="async" style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/04/image_thumb7.webp" border="0" alt="image" width="177" height="100" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Using Fast User Switching on domain XP computers</title><link>https://remkoweijnen.nl/blog/2011/01/30/using-fast-user-switching-on-domain-xp-computers/</link><pubDate>Sun, 30 Jan 2011 20:42:20 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/30/using-fast-user-switching-on-domain-xp-computers/</guid><description>&lt;p&gt;As you may know, Fast User Switching (FUS) is not available (disabled) on Windows XP computers joined to a domain, Microsoft confirms this in &lt;a href="http://support.microsoft.com/kb/280758" target="_blank"&gt;kb280758&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;However, Microsoft doesn&amp;rsquo;t tell us there&amp;rsquo;s an undocumented registry value that allows us to have FUS when joined to a domain!&lt;/p&gt;
&lt;p&gt;To enable FUS you need to set the &lt;strong&gt;DWORD&lt;/strong&gt; registry value &lt;em&gt;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\ForceFriendlyUI&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;It can also be set by Group Policy at &lt;em&gt;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;When the value is set to 1, and &lt;em&gt;LogonType&lt;/em&gt; key is also set to 1, it allows you to use a Friendly UI on a computer joined in a domain:&lt;/p&gt;</description></item><item><title>PowerShell Script to raise Citrix Video Memory</title><link>https://remkoweijnen.nl/blog/2011/01/28/powershell-script-to-raise-citrix-video-memory/</link><pubDate>Fri, 28 Jan 2011 15:23:08 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/28/powershell-script-to-raise-citrix-video-memory/</guid><description>&lt;p&gt;On a Citrix XenApp 5 environment a user reported that he was unable to start a Full Screen session on a Dual Monitor Configuration.&lt;/p&gt;
&lt;p&gt;He received this error message:&lt;/p&gt;
&lt;p&gt;&lt;a class="glightbox" data-type="image" data-gallery="post-1316" href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/01/foutmelding-2.webp"&gt;&lt;img loading="lazy" decoding="async" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="foutmelding (2)" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/01/foutmelding-2_thumb.webp" border="0" alt="foutmelding (2)" width="244" height="78" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Unattended Installation of IBM System i Access for Windows</title><link>https://remkoweijnen.nl/blog/2010/12/24/unattended-installation-of-ibm-system-i-access-for-windows/</link><pubDate>Fri, 24 Dec 2010 15:52:04 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/12/24/unattended-installation-of-ibm-system-i-access-for-windows/</guid><description>&lt;p&gt;Today I needed to script the installation of IBM System i Access for Windows (formerly called IBM Client Access).&lt;/p&gt;
&lt;p&gt;With older versions of this client (up to 5.4) you could use the -r (record) installer switch to record the install in a setup.iss file but version 6.1 uses an MSI based installer.&lt;/p&gt;
&lt;p&gt;IBM offers the client in a 2 DVD download but you probably only need the first dvd (dvd 1 has both the x86 and x64 installers, dvd 2 has the ia64 installer) which is a whopping 3,5 GB download.&lt;/p&gt;
&lt;p&gt;Inside the download (a zip) is an iso file of which you will only need the files in the root and the Image32 or Image64a folder.&lt;/p&gt;
&lt;p&gt;Inside the image folder are subfolders names MRI29xx where xx is a language identifier:&lt;/p&gt;
&lt;p&gt;The following Identifiers are used:&lt;/p&gt;</description></item><item><title>Packaging an application – Auto Accept the EULA</title><link>https://remkoweijnen.nl/blog/2010/12/17/packaging-an-application-auto-accept-the-eula/</link><pubDate>Fri, 17 Dec 2010 17:10:03 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/12/17/packaging-an-application-auto-accept-the-eula/</guid><description>&lt;p&gt;Yesterday I was packaging an application called Kluwer Juridische Bibliotheek. When the user first starts this application a screen with the License Conditions pops up and it must be accepted:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2010/12/kluwereula.webp" class="glightbox" data-type="image" data-gallery="post-879"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2010/12/kluwereula-small.webp" alt="KluwerEULA" width="430" height="399" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I always try to remove such things as I don&amp;rsquo;t think it&amp;rsquo;s necessary for every user to accept it.&lt;/p&gt;</description></item><item><title>Writing Environment Variables to the Registry from a Script</title><link>https://remkoweijnen.nl/blog/2010/12/13/writing-environment-variables-to-the-registry-from-a-script/</link><pubDate>Mon, 13 Dec 2010 20:52:59 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/12/13/writing-environment-variables-to-the-registry-from-a-script/</guid><description>&lt;p&gt;I usually change the text below the &amp;ldquo;This Computer&amp;rdquo; icon to reflect the current username and servername:&lt;/p&gt;
&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2010/12/useroncomputer.webp" alt="UserOnComputer" width="86" height="83" /&gt;
&lt;p&gt;This is an ancient trick, just set the the &lt;em&gt;LocalizedString&lt;/em&gt; Value of the following key:&lt;/p&gt;
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;span class="codelang"&gt;batch&lt;/span&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".bat" href="data:text/plain;charset=utf-8;base64,SEtFWV9DTEFTU0VTX1JPT1RcQ0xTSURcezIwRDA0RkUwLTNBRUEtMTA2OS1BMkQ4LTA4MDAyQjMwMzA5RH0="&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;pre class="language-batch"&gt;&lt;code class="language-batch"&gt;HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;to &amp;ldquo;%USERNAME% on %COMPUTERNAME%&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;It get&amp;rsquo;s a little more complicated if you want to set this from a script, because the environment variables are replaced with the actual value BEFORE they are entered in the Registry.&lt;/p&gt;</description></item><item><title>Citrix Web Interface starts very slowly</title><link>https://remkoweijnen.nl/blog/2010/11/26/citrix-web-interface-starts-very-slowly/</link><pubDate>Fri, 26 Nov 2010 15:07:45 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/11/26/citrix-web-interface-starts-very-slowly/</guid><description>&lt;p&gt;I remembered from a previous project that when the Citrix Web Interface this is caused by a setting called &lt;em&gt;generatePublisherEvidence&lt;/em&gt; in the Aspnet.config file.&lt;/p&gt;
&lt;p&gt;This behaviour has been documented by Citrix in &lt;a title="Web Interface 5.x Delay on First Page" href="http://support.citrix.com/article/ctx117273" target="_blank"&gt;CTX117273&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you read it carefully you will see the note that you need to fix it in 2 places for an x64 system.&lt;/p&gt;</description></item><item><title>Scripted creation of Server Manager Answer Files</title><link>https://remkoweijnen.nl/blog/2010/11/25/scripted-creation-of-server-manager-answer-files/</link><pubDate>Thu, 25 Nov 2010 16:14:42 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/11/25/scripted-creation-of-server-manager-answer-files/</guid><description>&lt;p&gt;A while ago I created a script that I can run as embedded script in Altiris that creates a Server Manager Answer File (for Server 2008).&lt;/p&gt;
&lt;p&gt;I could have simply done an echo &amp;gt;answer.xml but I wanted a well formed XML that could be read and displayed in an XML editor or Internet Explorer when needed.&lt;/p&gt;
&lt;p&gt;I use the Microsoft.XMLDom object in the script the create the XML and I think the code is easy to understand so I will just show it here:&lt;/p&gt;</description></item><item><title>WMI query to Win32_Product returns error 0x80041010</title><link>https://remkoweijnen.nl/blog/2010/11/12/wmi-query-to-win32_product-returns-error-0x80041010/</link><pubDate>Fri, 12 Nov 2010 15:57:07 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/11/12/wmi-query-to-win32_product-returns-error-0x80041010/</guid><description>&lt;p&gt;I ran a VBScript that queries the Win32_Product WMI class on Windows 2003 but it returned error 0x80041010 instead of the expected results.&lt;/p&gt;
&lt;p&gt;I looked up that errorcode and it means WBEM_E_INVALID_CLASS. This happened because the &amp;ldquo;WMI Windows Installer Provider&amp;rdquo; was not installed.&lt;/p&gt;</description></item><item><title>The messaging interface has returned an unknown error</title><link>https://remkoweijnen.nl/blog/2009/06/12/the-messaging-interface-has-returned-an-unknown-error/</link><pubDate>Fri, 12 Jun 2009 12:18:09 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/06/12/the-messaging-interface-has-returned-an-unknown-error/</guid><description>&lt;p&gt;Today someone asked questions about a script I wrote back in 2007 to solve a bug in Outlook (2003 but at least Outlook XP has the same issue). If you have access to someone&amp;rsquo;s calendar and want to make a print of it Outlook wants to print it in it&amp;rsquo;s default view which is a combined view on calendar appointments and tasks. However if you do not have permissions to the other persons tasks folder Outlook refuses to print and displays the following error: &lt;strong&gt;The messaging interface has returned an unknown error. If the problem persists, restart Outlook.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To resolve it you can go to the Calendar | Daily View | Print, then click Page Setup and under Include Options deselect Taskpad. I didn&amp;rsquo;t want to do this for all users that&amp;rsquo;s why I wrote the script.&lt;/p&gt;</description></item><item><title>Unattended Citrix Installation: Could not Access the datastore using the DSN file</title><link>https://remkoweijnen.nl/blog/2008/06/23/error-26009-could-not-access-the-datastore-using-the-dsn-file/</link><pubDate>Mon, 23 Jun 2008 22:11:21 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/06/23/error-26009-could-not-access-the-datastore-using-the-dsn-file/</guid><description>&lt;p&gt;I was working on an unattended installation of Citrix Presentation Server 4.5 or rather Citrix Xenapp. I was creating the dsn file for the installation by a script that uses the echo command and output this to a file.&lt;/p&gt;
&lt;p&gt;This is a part of the script:&lt;/p&gt;</description></item><item><title>Encrypt RDP password in Python</title><link>https://remkoweijnen.nl/blog/2007/11/05/encrypt-rdp-password-in-python/</link><pubDate>Mon, 05 Nov 2007 23:10:29 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/11/05/encrypt-rdp-password-in-python/</guid><description>&lt;p&gt;Dirk Schmitz send me his Python version of encrypting the RDP Password:&lt;/p&gt;
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;span class="codelang"&gt;python&lt;/span&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".py" href="data:text/plain;charset=utf-8;base64,aW1wb3J0IHdpbjMyY3J5cHQKaW1wb3J0IGJpbmFzY2lpCgpwd2RIYXNoID0gd2luMzJjcnlwdC5DcnlwdFByb3RlY3REYXRhKHUiTVlQQVNTV09SRCIsdSdwc3cnLE5vbmUsTm9uZSxOb25lLDApCnByaW50IGJpbmFzY2lpLmhleGxpZnkocHdkSGFzaCk="&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;pre class="language-python"&gt;&lt;code class="language-python"&gt;import win32crypt
import binascii

pwdHash = win32crypt.CryptProtectData(u&amp;#34;MYPASSWORD&amp;#34;,u&amp;#39;psw&amp;#39;,None,None,None,0)
print binascii.hexlify(pwdHash)&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br&gt;Read the original article here: &lt;a href="https://remkoweijnen.nl/blog/2007/10/18/how-rdp-passwords-are-encrypted/"&gt;/2007/10/18/how-rdp-passwords-are-encrypted/&lt;/a&gt;&lt;/p&gt;
&lt;section class="comments"&gt;
&lt;h2&gt;5 Comments&lt;/h2&gt;
&lt;ol class="comment-list"&gt;
&lt;li class="comment depth-0"&gt;&lt;div class="comment-meta"&gt;&lt;span class="comment-author"&gt;Arvid Requate&lt;/span&gt; &lt;time datetime="2010-11-14"&gt;Nov 14, 2010&lt;/time&gt;&lt;/div&gt;&lt;div class="comment-body"&gt;&lt;p&gt;Thank's, this really worked well, after a bit of fiddling (donation will be given asap). For Python 2.7 I had to remove the unicode conversion, otherwise the RDP server would not get the proper password. Interestingly your updated post about 512-byte padding and appending a '0'-character to obtain a 1329 'password 51'-hash did not work for me yet. Did you need the padding as a bugfix or did you suggest it merely as an imrovement to become fully compatible to the MS encoding format? (/2008/03/02/how-rdp-passwords-are-encrypted-2/).&lt;/p&gt;</description></item><item><title>Query Active Directory from Excel</title><link>https://remkoweijnen.nl/blog/2007/11/01/query-active-directory-from-excel/</link><pubDate>Thu, 01 Nov 2007 18:23:55 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/11/01/query-active-directory-from-excel/</guid><description>&lt;p&gt;I had to lookup some users in Active Directory today which I received by mail. Offcourse I got full users name while I needed either samAccountName or full adsPath. Usually I write a small VBS script to do the lookup and paste this in Excel for further processing. But today I decided that an Excel function to do the lookup would be nice. So I wrote it.&lt;/p&gt;
&lt;p&gt;The function is called GetAdsProp and allows you to search on a specific AD field in the whole AD tree and return the value of another field.&lt;/p&gt;</description></item><item><title>Script to clear SQL Transactions logs</title><link>https://remkoweijnen.nl/blog/2007/10/28/script-to-clear-sql-transactions-logs/</link><pubDate>Sun, 28 Oct 2007 13:11:15 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/10/28/script-to-clear-sql-transactions-logs/</guid><description>&lt;p&gt;Script to clear SQL Transactions Logs&lt;/p&gt;
&lt;p&gt;Did you know that when you backup a SQL database with Backup Exec (with the SQL Agent) the transaction log is not cleared? This means that if you use the full recovery model your transaction log keeps growing and growing. I tested this with Backup Exec v11D and you can only create a seperate scheduled job to backup the transactions logs but not one to just clear it or truncate it after successfull backup.&lt;/p&gt;
&lt;p&gt;Therefore I made a VBS script that clears SQL transactions logs, an option would be to schedule this as a post backup job.&lt;/p&gt;
&lt;p&gt;This is the script:&lt;/p&gt;</description></item></channel></rss>