<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Terminal Server on Remko's Blog</title><link>https://remkoweijnen.nl/blog/categories/terminal-server/</link><description>Recent content in Terminal Server on Remko's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 15 Aug 2013 11:27:15 +0000</lastBuildDate><atom:link href="https://remkoweijnen.nl/blog/categories/terminal-server/index.xml" rel="self" type="application/rss+xml"/><item><title>RD Gateway connection fails on Windows 7</title><link>https://remkoweijnen.nl/blog/2013/08/15/rd-gateway-connection-fails-on-windows-7/</link><pubDate>Thu, 15 Aug 2013 11:27:15 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2013/08/15/rd-gateway-connection-fails-on-windows-7/</guid><description>&lt;p&gt;I needed to connect remotely via Remote Desktop to a Windows Server 2012 machine.&lt;/p&gt;
&lt;p&gt;I received an rdp file that was configured to use an RD Gateway server:&lt;/p&gt;
&lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2013/08/SNAGHTML243e76.webp" data-type="image" data-gallery="post-3363"&gt;&lt;img loading="lazy" decoding="async" style="display: inline;" title="RD Gateway Server Settings" alt="Remtoe Desktop Connection | RD Gateway Server Settings" src="https://remkoweijnen.nl/blog/wp-content/uploads/2013/08/SNAGHTML243e76_thumb.webp" width="213" height="240" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;However when trying to connect from my Windows 7 laptop (x64) machine, I got the following error message:&lt;/p&gt;
&lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2013/08/SNAGHTML2c46b0.webp" data-type="image" data-gallery="post-3363"&gt;&lt;img loading="lazy" decoding="async" style="display: inline;" title="Remote Desktop Connection" alt="The two computers couldn't connect in the amount of time allocated. Try connecting again. If the problem continues, contact your network administrator or technical support." src="https://remkoweijnen.nl/blog/wp-content/uploads/2013/08/SNAGHTML2c46b0_thumb.webp" width="294" height="87" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Return username instead of computername in a ThinApp</title><link>https://remkoweijnen.nl/blog/2013/01/15/return-username-instead-of-computername-in-a-thinapp/</link><pubDate>Tue, 15 Jan 2013 11:50:07 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2013/01/15/return-username-instead-of-computername-in-a-thinapp/</guid><description>&lt;p&gt;&lt;img style="display: inline; float: right" alt="File:VMware ThinApp v4.0 icon.png" align="right" src="http://upload.wikimedia.org/wikipedia/commons/c/c0/VMware_ThinApp_v4.0_icon.png" width="95" height="95" /&gt;One of the lesser known features of VMware ThinApp is that you can supply a Virtual Computer name.&lt;/p&gt; &lt;p&gt;This is documented as follows in the &lt;a href="http://www.vmware.com/pdf/thinapp47_packageini_reference.pdf"&gt;package.ini reference guide&lt;/a&gt;:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;VirtualComputerName Parameter&lt;/strong&gt; &lt;br /&gt;The VirtualComputerName parameter determines whether to rename the computer name, to avoid naming conflicts between the capture process and the deployment process.&lt;/p&gt;</description></item><item><title>Return username instead of computername to Applications</title><link>https://remkoweijnen.nl/blog/2012/12/06/return-username-instead-of-computername-to-applications/</link><pubDate>Thu, 06 Dec 2012 10:45:40 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/12/06/return-username-instead-of-computername-to-applications/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image8.webp" class="glightbox thickbox" data-type="image" data-gallery="post-2841"&gt;&lt;img loading="lazy" decoding="async" style="display: inline; float: right" title="image" alt="image" align="right" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image_thumb8.webp" width="87" height="74" /&gt;&lt;/a&gt;Some applications use the computer's name as a unique identifier, rather than using the user name. In a single-user-per-computer environment, this strategy works well. &lt;/p&gt; &lt;p&gt;However, in a Multi User environment such as Citrix XenApp or Microsoft's Remote Desktop Services (Terminal Server), all connected users report the same computername. &lt;/p&gt; &lt;p&gt;If the application relies on unique computernames to handle tasks such as file and record locking, then the application will fail. &lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image9.webp" class="glightbox thickbox" data-type="image" data-gallery="post-2841"&gt;&lt;img loading="lazy" decoding="async" style="margin: 11px 6px 5px 0px; display: inline; float: left" title="image" alt="image" align="left" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image_thumb9.webp" width="32" height="32" /&gt;&lt;/a&gt;We can however set an &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;186499"&gt;Application Compatibility Flag&lt;/a&gt; in the registry to return the username instead of the computername.&lt;/p&gt; &lt;p&gt;To demonstrate this behaviour I wrote a small Test Application called TestAppCompatFlags.exe.&lt;/p&gt;</description></item><item><title>File not found error when scanning using Twain Redirection in Citrix XenApp</title><link>https://remkoweijnen.nl/blog/2012/12/04/file-not-found-error-when-scanning-using-twain-redirection-in-citrix-xenapp/</link><pubDate>Tue, 04 Dec 2012 15:07:10 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/12/04/file-not-found-error-when-scanning-using-twain-redirection-in-citrix-xenapp/</guid><description>&lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image.webp" data-type="image" data-gallery="post-2795"&gt;&lt;img loading="lazy" decoding="async" style="margin: 0px 0px 2px; display: inline; float: right;" title="Twain" src="https://remkoweijnen.nl/blog/wp-content/uploads/2012/12/image_thumb.webp" alt="Twain Logo" width="75" height="70" align="right" /&gt;&lt;/a&gt;Scanners attached to client machines can be used from within a Citrix XenApp session via a mechanism called Twain Redirection.&lt;/p&gt;
&lt;p&gt;For this mechanism to work correctly the file twain_32.dll must be present in the Windows directory.&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #35383d;"&gt;On Windows 2008 this dll should be copied from winsxs (side by side) to the windows directory as described in &lt;a href="http://support.citrix.com/article/CTX123981"&gt;CTX123981&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;On Windows 2003 the dll is already in the correct directory, however applications that are not &lt;a href="http://msdn.microsoft.com/en-us/library/01cfys9z%28v=vs.80%29.aspx"&gt;Terminal Server Aware&lt;/a&gt; cannot find this dll because the Windows directory is redirected to the user profile. Citrix recommends copying twain_32.dll to each user&amp;rsquo;s profile directory but this will take up unnecessary space.&lt;/p&gt;
&lt;p&gt;So what alternatives do we have?&lt;/p&gt;</description></item><item><title>NTVDM encountered a hard error</title><link>https://remkoweijnen.nl/blog/2011/12/14/ntvdm-encountered-a-hard-error/</link><pubDate>Wed, 14 Dec 2011 21:41:22 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/12/14/ntvdm-encountered-a-hard-error/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image7.webp" class="glightbox" data-type="image" data-gallery="post-2254"&gt;&lt;img loading="lazy" decoding="async" style="margin: 0px 3px 0px 0px; display: inline; float: left" title="MS-Dos Logo" alt="MS-Dos Logo" align="left" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image_thumb7.webp" width="74" height="82" /&gt;&lt;/a&gt;Today I troubleshooted an old DOS application that needed to run on a 32 bit Citrix XenApp Server. The last time I saw an actual DOS application in a production environment must be years ago.&lt;/p&gt; &lt;p&gt;When starting the application, the WOW subsystem (NTVDM) crashed with the message: "NTVM encountered a hard error.":&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image8.webp" class="glightbox" data-type="image" data-gallery="post-2254"&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="ntvdm.exe - System Error" border="0" alt="NTVDM encoutered a hard error" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image_thumb8.webp" width="198" height="104" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;After spending some time troubleshooting I remembered a similar issue from a few years ago where a DOS application worked fine from the Console but refused to work from an RDP or ICA session.&lt;/p&gt;</description></item><item><title>SSL Certificates in termsrv.dll</title><link>https://remkoweijnen.nl/blog/2011/05/02/ssl-certificates-in-termsrv-dll/</link><pubDate>Mon, 02 May 2011 14:54:39 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/05/02/ssl-certificates-in-termsrv-dll/</guid><description>&lt;p&gt;I was digging around in termsrv.dll yesterday when I noticed that there are some (well 372 to be exact) SSL certificates inside the Terminal Server binary (termsrv.dll):&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/05/image7.webp" class="glightbox" data-type="image" data-gallery="post-1726"&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="image" border="0" alt="image" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/05/image_thumb7.webp" width="416" height="195" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Two of them seem to actually contain the private keys as well, but I am not 100% sure it may be just a certificate in another format.&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt;</description></item><item><title>Autologon user on Windows XP/2003 using AutoReconnect pipe - part 3 (implementation details)</title><link>https://remkoweijnen.nl/blog/2011/03/03/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-3-implementation-details/</link><pubDate>Thu, 03 Mar 2011 13:00:46 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/03/03/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-3-implementation-details/</guid><description>&lt;p&gt;In the previous parts (&lt;a href="https://remkoweijnen.nl/blog/2011/02/09/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-1-theory/"&gt;part 1&lt;/a&gt; &lt;a href="https://remkoweijnen.nl/blog/2011/03/02/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-2-problems-and-workarounds/"&gt;part 2&lt;/a&gt;) i&amp;rsquo;ve described the theoretical part and implementation problems. So, now we can write the code:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In case we login the user, we just call &lt;a href="http://msdn.microsoft.com/en-us/library/aa378292(v=vs.85).aspx"&gt;LsaLogonUser&lt;/a&gt; to get the token:&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Autologon user on Windows XP/2003 using AutoReconnect pipe - part 2 (problems and workarounds)</title><link>https://remkoweijnen.nl/blog/2011/03/02/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-2-problems-and-workarounds/</link><pubDate>Wed, 02 Mar 2011 00:10:02 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/03/02/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-2-problems-and-workarounds/</guid><description>&lt;p&gt;In &lt;a href="https://remkoweijnen.nl/blog/2011/02/09/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-1-theory/"&gt;part 1&lt;/a&gt; I&amp;rsquo;ve described the theoretical parts needed for a custom autologon application implementation.&lt;/p&gt;
&lt;p&gt;But there are some practical problems which I will describe here.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I use the &lt;a href="http://msdn.microsoft.com/en-us/library/aa378292(v=vs.85).aspx"&gt;LsaLogonUser&lt;/a&gt; function to log in the user. However, if I do not pass not null for the &lt;em&gt;LocalGroups&lt;/em&gt; parameter, msgina.dll fails to process the logon.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Why? Because it looks for the &lt;strong&gt;SE_GROUP_LOGON_ID&lt;/strong&gt; SID and treat it as logon SID. So we have to add the logon SID manually:&lt;/p&gt;</description></item><item><title>Autologon user on Windows XP/2003 using AutoReconnect pipe - part 1 (theory)</title><link>https://remkoweijnen.nl/blog/2011/02/28/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-1-theory/</link><pubDate>Mon, 28 Feb 2011 10:46:29 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/02/28/autologon-user-on-windows-xp2003-using-autoreconnect-pipe-part-1-theory/</guid><description>&lt;p&gt;Windows XP introduced the ability to use Fast User Switching (FUS from here on), which is implemented using &lt;em&gt;Terminal Services&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;But in some cases (i.e. when FUS is not enabled, or when you connect to the console in Windows 2003 server), the Winlogon process in an RDP session needs to transfer credentials to Session 0.&lt;/p&gt;
&lt;p&gt;Although not documented in MSDN, the process of transferring credentials is described by Keith Brown in the June 2005 issue of MSDN magazine: &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163786.aspx"&gt;Customizing GINA, Part 2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa380577(v=vs.85).aspx"&gt;WlxQueryConsoleSwitchCredentials&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/aa380563(v=vs.85).aspx"&gt;WlxGetConsoleSwitchCredentials&lt;/a&gt; are used in the transfer with the semi-documented &lt;strong&gt;WLX_SAS_TYPE_AUTHENTICATED&lt;/strong&gt; SAS code constant.&lt;/p&gt;
&lt;p&gt;Internally, &lt;em&gt;winlogon.exe&lt;/em&gt; uses a Named Pipe, &lt;strong&gt;\.\Pipe\TerminalServer\AutoReconnect, &lt;/strong&gt;to implement both of these functions.&lt;/p&gt;
&lt;p&gt;The pipe format is described in this structure:&lt;/p&gt;</description></item><item><title>The Case of the Citrix Ready Printer Driver</title><link>https://remkoweijnen.nl/blog/2011/02/08/the-case-of-the-citrix-ready-printer-driver/</link><pubDate>Tue, 08 Feb 2011 21:47:44 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/02/08/the-case-of-the-citrix-ready-printer-driver/</guid><description>&lt;p&gt;I had a very interesting issue today on a new Citrix XenApp 5 farm. We went into production yesterday and we noticed a number of issues:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;span style="color: #35383d;"&gt;Printing in general was slow, especially when a user connects to a printer for the first time.&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;User Profiles were rapidly growing in size (from the expected 1-2 MB to over 40 MB).&lt;/li&gt;
	&lt;li&gt;Logons took much longer then in the testing period (and since we use a Full Screen Desktop the user doesn't see any progress).&lt;/li&gt;
	&lt;li&gt;Performance monitoring showed CPU spikes in Word, Excel and IE processes.&lt;/li&gt;
&lt;/ul&gt;
&lt;span style="color: #4c4c4c;"&gt;I took a look at the profiles first and noticed that the size growth was due to a Xerox subfolder in %APPDATA%:</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>Querying a user token under 64 bit version of 2003/XP</title><link>https://remkoweijnen.nl/blog/2011/01/29/querying-a-user-token-under-64-bit-version-of-2003xp/</link><pubDate>Sat, 29 Jan 2011 22:17:52 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/29/querying-a-user-token-under-64-bit-version-of-2003xp/</guid><description>&lt;p&gt;If you want to obtain a user&amp;rsquo;s token in a Terminal Server or Citrix session (eg to launch a process in a session) you can call the &lt;a href="http://msdn.microsoft.com/en-us/library/aa383840(v=vs.85).aspx"&gt;WTSQueryUserToken&lt;/a&gt; function.&lt;/p&gt;
&lt;p&gt;On the x64 versions of Windows XP and Server 2003 this function fails however and returns &lt;strong&gt;ERROR_INSUFFICIENT_BUFFER&lt;/strong&gt; (&amp;quot;&lt;em&gt;The data area passed to a system call is too small&lt;/em&gt;.&amp;quot;) when called from a 32 bit process.&lt;/p&gt;
&lt;p&gt;Internally WTSQueryUserToken calls the undocumented function &lt;a href="http://msdn.microsoft.com/en-us/library/aa383827(v=vs.85).aspx"&gt;WinstationQueryInformationW&lt;/a&gt; with the &lt;strong&gt;WinStationUserToken&lt;/strong&gt; class (14) and passing a &lt;a href="http://msdn.microsoft.com/en-us/library/cc248658(PROT.10).aspx"&gt;WINSTATIONUSERTOKEN&lt;/a&gt; struct, filled with caller ProcessId and ThreadId.&lt;/p&gt;
&lt;p&gt;But on x64 Windows the size of this structure is 24 bytes, while on 32 bit Windows the size of the structure is 12 bytes!&lt;/p&gt;</description></item><item><title>Script to install all print drivers on Citrix or Terminal Server</title><link>https://remkoweijnen.nl/blog/2011/01/25/script-to-install-all-print-drivers-on-citrix-or-terminal-server/</link><pubDate>Tue, 25 Jan 2011 15:24:14 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/25/script-to-install-all-print-drivers-on-citrix-or-terminal-server/</guid><description>&lt;p&gt;I wrote a PowerShell script to install all printer drivers on a Citrix or Terminal Server.&lt;/p&gt;
&lt;p&gt;Actually the script isn&amp;rsquo;t specific to Citrix or Terminal Server but on such environments we need to preload all drivers because users do not have the permissions to do that.&lt;/p&gt;
&lt;p&gt;I have chosen for PowerShell because you can do it in a one-liner which makes it easy to run this script from my Altiris server on all Citrix Servers.&lt;/p&gt;
&lt;p&gt;The idea is that we enumerate all the shared printers on a Printer Server and make a connection to each printer. This will make sure that the driver is installed if it wasn&amp;rsquo;t already present.&lt;/p&gt;
&lt;p&gt;The script could even be scheduled to enforce that newly added printer drivers are added to each Citrix Server.&lt;/p&gt;</description></item><item><title>SasLibEx Screencast</title><link>https://remkoweijnen.nl/blog/2011/01/19/saslibex-screencast/</link><pubDate>Wed, 19 Jan 2011 22:36:44 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/19/saslibex-screencast/</guid><description>&lt;p&gt;I just recorded a SasLibEx Screencast, it shows some of the very powerfull features of SasLibEx.&lt;/p&gt;
&lt;p&gt;The following features are shown:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;span style="color: #35383d;"&gt;Simulate Ctrl Alt Del (Secure Attention Sequence)&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span style="color: #35383d;"&gt;Cancel Ctrl Alt Del&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span style="color: #35383d;"&gt;Lock Workstation&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span style="color: #35383d;"&gt;Unlock Workstation (without credentials)&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span style="color: #35383d;"&gt;Disable Ctrl Alt Del&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span style="color: #35383d;"&gt;Enable Ctrl Alt Del again&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span style="color: #35383d;"&gt;Cancel pending UAC request&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span style="color: #35383d;"&gt;Is Desktop Locked&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:8c371d04-5435-4a86-a54a-5611345258b5" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;div&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="448" height="252" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="src" value="http://www.youtube.com/v/Nyl4_ECe5xI?hl=en&amp;amp;hd=1" /&gt;&lt;embed type="application/x-shockwave-flash" width="448" height="252" src="http://www.youtube.com/v/Nyl4_ECe5xI?hl=en&amp;amp;hd=1"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;
&lt;div style="width: 448px; clear: both; font-size: 0.8em;"&gt;SasLibEx Feature Demo #1&lt;/div&gt;
&lt;/div&gt;
&lt;section class="comments"&gt;
&lt;h2&gt;1 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;&lt;a href="http://topsy.com/www.remkoweijnen.nl/blog/2011/01/19/saslibex-screencast/?utm_source=pingback&amp;amp;amp;utm_campaign=L2" rel="nofollow ugc"&gt;Tweets die vermelden SasLibEx Screencast | Remko Weijnen&amp;#x27;s Blog (Remko&amp;#x27;s Blog) -- Topsy.com&lt;/a&gt;&lt;/span&gt; &lt;time datetime="2011-01-20"&gt;Jan 20, 2011&lt;/time&gt;&lt;/div&gt;&lt;div class="comment-body"&gt;&lt;p&gt;[...] Dit blogartikel was vermeld op Twitter door Remko Weijnen, Remko Weijnen. Remko Weijnen heeft gezegd: First #SasLibEx ScreenCast! showing simulate ctrl alt del, unlock workstation without credentials, disable cad and more http://bit.ly/fFM8wB [...]&lt;/p&gt;</description></item><item><title>Self Signing Word Macro’s</title><link>https://remkoweijnen.nl/blog/2011/01/12/self-signing-word-macros/</link><pubDate>Wed, 12 Jan 2011 15:45:51 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/12/self-signing-word-macros/</guid><description>&lt;p&gt;Today I noticed that a recently added Application to the Citrix Test environment added a Macro to the Office Startup directory.&lt;/p&gt;
&lt;p&gt;When a user launches Word he will get a popup because the Template (.dot file) was not signed:&lt;/p&gt;
&lt;p&gt;&lt;a class="glightbox" data-type="image" data-gallery="post-1175" href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/01/OfficeMacro.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="OfficeMacro" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/01/OfficeMacro_thumb.webp" border="0" alt="OfficeMacro" width="244" height="128" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It would have been a lot easier if Application Vendors sign their stuff because in that case I could have just added the certificate using Group Policy (&lt;a href="https://remkoweijnen.nl/blog/2011/01/11/java-webapplication-certificates-and-citrix/" target="_blank"&gt;yesterday&amp;rsquo;s post&lt;/a&gt; describes how to do this).&lt;/p&gt;
&lt;p&gt;Application Vendors usually tell you that you should lower the Macro security in Office (or Word in this case) to Low to get rid of this message. But I think there&amp;rsquo;s a better solution: we will sign the .dot file ourselves!&lt;/p&gt;</description></item><item><title>Java Webapplication, certificates and Citrix</title><link>https://remkoweijnen.nl/blog/2011/01/11/java-webapplication-certificates-and-citrix/</link><pubDate>Tue, 11 Jan 2011 15:23:47 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/11/java-webapplication-certificates-and-citrix/</guid><description>&lt;p&gt;Yesterday I created an Unattended Installation of a webapplication. Of course it was &amp;ldquo;just a web link&amp;rdquo; and the application vendor usually says: you don&amp;rsquo;t need to install it just go the URL and that&amp;rsquo;s it.&lt;/p&gt;
&lt;p&gt;The reality is usually that you go to the URL and need to install several (ActiveX) components and maybe other dependencies such as Java.&lt;/p&gt;
&lt;p&gt;While a user may have the permissions for this on his own pc, on a Citrix or Terminal Server environment this is highly unlikely.&lt;/p&gt;
&lt;p&gt;So we need to package and pre-install this for the users.&lt;/p&gt;
&lt;p&gt;Nothing special so far but this particular application had some special things that were interesting enough to blog about.&lt;/p&gt;
&lt;p&gt;So let&amp;rsquo;s start with what happened, I visited the URL of an application called Centric Key 2 Financien.&lt;/p&gt;
&lt;p&gt;First I got a few popups with Certificates that needed to be accepted:&lt;/p&gt;
&lt;p&gt;&lt;a class="glightbox" data-type="image" data-gallery="post-1147" href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/01/Cert1.png"&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="Cert1" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/01/Cert1_thumb.webp" border="0" alt="Cert1" width="244" height="150" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The application&amp;rsquo;s instructions say that the user must accept this and set the &amp;ldquo;Always trust content from this publisher&amp;rdquo; checkbox.&lt;/p&gt;</description></item><item><title>Paging file and Memory Dump</title><link>https://remkoweijnen.nl/blog/2011/01/07/paging-file-and-memory-dump/</link><pubDate>Fri, 07 Jan 2011 13:45:55 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/07/paging-file-and-memory-dump/</guid><description>&lt;p&gt;I often hear that people configure the Paging File (on Citrix or Terminal Servers) on a seperate volume but, the reasons is either performance or the chance that the Paging File might corrupt the volume.&lt;/p&gt;
&lt;p&gt;However if at some point you would like to create a Memory Dump you must have a paging file on the boot volume.&lt;/p&gt;</description></item><item><title>Default User Profile: Remko’s solution</title><link>https://remkoweijnen.nl/blog/2011/01/04/default-user-profile-remkos-solution/</link><pubDate>Tue, 04 Jan 2011 15:46:18 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/01/04/default-user-profile-remkos-solution/</guid><description>&lt;p&gt;If you are implementing a Citrix, Terminal Server or even just a plain Client-Server environment you will need to create a Default User Profile at some point.&lt;/p&gt;
&lt;p&gt;The Default User Profile can be thought of as the initial registry settings that are used when a new profile is created.&lt;/p&gt;
&lt;p&gt;Many people think that the Default User Profile is available in regedit via HKEY_USERS.Default but this is NOT the Default User Profile.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/01/usersdefault.webp" class="glightbox" data-type="image" data-gallery="post-1066"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/01/usersdefault-small.webp" alt="UsersDefault" width="430" height="165" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Terminal Server Remote Keyboard Layout</title><link>https://remkoweijnen.nl/blog/2010/12/27/terminal-server-remote-keyboard-layout/</link><pubDate>Mon, 27 Dec 2010 16:38:55 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/12/27/terminal-server-remote-keyboard-layout/</guid><description>&lt;p&gt;Today I shadowed a user&amp;rsquo;s session in Citrix and when I wanted to type something I noticed that the keyboard layout was incorrect.&lt;/p&gt;
&lt;p&gt;This is and old &amp;ldquo;friend&amp;rdquo; that I always tend to forget about. So hopefully this post will help me to remember it :D.&lt;/p&gt;
&lt;p&gt;You can prevent this by adding a value &amp;ldquo;IgnoreRemoteKeyboardLayout&amp;rdquo; to the registry key HKLM\System\CurrentControlSet\Keyboard Layout:&lt;/p&gt;
&lt;blockquote&gt;reg add "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout" /v IgnoreRemoteKeyboardLayout /t REG_DWORD /d 0x00000001 /f&lt;/blockquote&gt;
This option has been present since Windows 2000 but was broken in Windows 2003. For Windows 2003 there are two related hotfixes, see &lt;a title="The IgnoreRemoteKeyboardLayout registry entry has no effect in Windows Server 2003" href="http://support.microsoft.com/kb/842136" target="_blank"&gt;kb 842136&lt;/a&gt; and &lt;a title="The terminal server IME keyboard layout differs from the client computer when you remotely log on to a Windows Server 2003 SP1-based terminal server" href="http://support.microsoft.com/kb/917910" target="_blank"&gt;kb 917910&lt;/a&gt;.</description></item><item><title>Default Explorer View</title><link>https://remkoweijnen.nl/blog/2010/12/19/default-explorer-view/</link><pubDate>Sun, 19 Dec 2010 14:40:40 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/12/19/default-explorer-view/</guid><description>&lt;p&gt;As you probably know there are several different Folder Views in Windows Explorer:&lt;/p&gt;
&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2010/12/explorerview.webp" alt="ExplorerView" width="183" height="276" /&gt;
&lt;p&gt;The Explorer keeps tracks of the last used View per Folder in the registry in the key HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Bags. This &lt;a title="Changes to the size, view, icon or position of a folder are lost" href="http://support.microsoft.com/kb/813711" target="_blank"&gt;KB article&lt;/a&gt; sort of desribes this functionality.&lt;/p&gt;</description></item><item><title>Copying files larger than 2GB in an RDP Session</title><link>https://remkoweijnen.nl/blog/2010/12/15/copying-files-larger-than-2gb-in-an-rdp-session/</link><pubDate>Wed, 15 Dec 2010 14:00:50 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/12/15/copying-files-larger-than-2gb-in-an-rdp-session/</guid><description>&lt;p&gt;Just had a good laugh while reading Microsoft &lt;a title="Copying files larger than 2 GB over a Remote Desktop Services or Terminal Services session by using Clipboard Redirection (copy and paste) fails silently" href="http://support.microsoft.com/kb/2258090" target="_blank"&gt;KB article 2258090&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;When you try to copy a file that is larger than 2 GB over a Remote Desktop Services or a Terminal Services session through Clipboard Redirection (copy and paste) by using the RDP client 6.0 or a later version, the file is not copied. And, you do not receive an error message.&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&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;span class="codelang"&gt;batch&lt;/span&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;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-batch" data-lang="batch"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&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>Automatically Accept Shadow Request</title><link>https://remkoweijnen.nl/blog/2010/10/22/automatically-accept-shadow-request/</link><pubDate>Fri, 22 Oct 2010 17:04:00 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2010/10/22/automatically-accept-shadow-request/</guid><description>&lt;p&gt;When you request Shadow (Remote Control) of a Remote Desktop (Terminal Server) or Citrix session the user gets a Dialog where he can Accept or Deny the Shadow Request.&lt;/p&gt;
&lt;p&gt;It looks something like this:&lt;/p&gt;
&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2010/10/shadowrequest.webp" alt="ShadowRequest" width="396" height="152" /&gt;
&lt;p&gt;It&amp;rsquo;s possible to change the default settings and remove the need for this permission but I think this is a bad idea since it violates the user&amp;rsquo;s privacy.&lt;/p&gt;
&lt;p&gt;But sometimes it would be convenient to automatically accept, for instance for when a user is away or when you want to shadow a session that is &amp;ldquo;yours&amp;rdquo; but runs under another account.&lt;/p&gt;
&lt;p&gt;I wrote a tool to do just that :D&lt;/p&gt;</description></item><item><title>Removing the Uninstall or change a program button from the Explorer Command Bar</title><link>https://remkoweijnen.nl/blog/2009/11/25/removing-the-uninstall-or-change-a-program-button-from-the-explorer-command-bar/</link><pubDate>Wed, 25 Nov 2009 10:52:13 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/11/25/removing-the-uninstall-or-change-a-program-button-from-the-explorer-command-bar/</guid><description>&lt;p&gt;Windows Vista introduced the Command Bar in Explorer which is sometimes also referred to as the Folder Band or the Task Band. The Command Bar is of course also present in Windows 7 and Server 2008 (R2).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2009/11/commandbar.webp" class="glightbox" data-type="image" data-gallery="post-477"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/11/commandbar-small.webp" alt="CommandBar" width="430" height="92" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This Command Bar shows possible tasks or actions depending on the active folder. I wanted to remove the &amp;ldquo;Uninstall or change a program&amp;rdquo; (in Dutch this is called &amp;ldquo;Een programma verwijderen of wijzigen&amp;rdquo;) button from the Computer view:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2009/11/commandbarbutton.webp" class="glightbox" data-type="image" data-gallery="post-477"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/11/commandbarbutton-small.webp" alt="CommandBarButton" width="430" height="92" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Adding a Printer Connection with an alternative driver</title><link>https://remkoweijnen.nl/blog/2009/11/16/adding-a-printer-connection-with-an-alternative-driver/</link><pubDate>Mon, 16 Nov 2009 10:59:13 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/11/16/adding-a-printer-connection-with-an-alternative-driver/</guid><description>&lt;p&gt;I needed to add a printer connection to a Citrix server but the problem was that this printer had a buggy driver. I wanted to use an alternative driver such as the Citrx Universal Printer driver but on Terminal Server you might want to use the Terminal Services Easy Print driver.&lt;/p&gt;
&lt;p&gt;So I decided to make something that could be used in both situations, the result is a small commandline tool called AddPrinter2 (sorry I am not good in finding original names).&lt;/p&gt;
&lt;p&gt;It takes 2 parameters: the printername as unc path and the driver name. An example would be:&lt;/p&gt;
&lt;p&gt;AddPrinter2 &amp;ldquo;\server\printer&amp;rdquo; &amp;ldquo;Citrix Universal Printer&amp;rdquo;.&lt;/p&gt;</description></item><item><title>Small LaunchRDP Update</title><link>https://remkoweijnen.nl/blog/2009/11/06/small-launchrdp-update/</link><pubDate>Fri, 06 Nov 2009 22:44:27 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/11/06/small-launchrdp-update/</guid><description>&lt;p&gt;For a long time now people have asked for a version of &lt;a href="https://remkoweijnen.nl/blog/2007/10/17/launch-rdp-from-commandline/"&gt;LaunchRDP&lt;/a&gt; that includes the Connection Bar. The original version was originally written for a very specific purpose and I never anticipated so many people would want to use it. But it seems that a lot of people like the Connection Bar (I hate it, especially with sessions in sessions, so that&amp;rsquo;s why I am using &lt;a href="https://remkoweijnen.nl/blog/2008/11/02/rdp-session-with-local-taskbar-visible/"&gt;RDPWithLocalTaskbar&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Delegated Management Console</title><link>https://remkoweijnen.nl/blog/2009/06/12/delegated-management-console/</link><pubDate>Fri, 12 Jun 2009 21:40:20 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/06/12/delegated-management-console/</guid><description>&lt;p&gt;In this topic I just want to show(case) you something I created in the past. It is a management console that enables delegated management in a Terminal Server or Citrix environment.&lt;/p&gt;
&lt;p&gt;The console is launched by a small executable that check credentials (based on group membership) and then launches an RDP session with the actual console in it. The logic behind it is that the RDP session runs with an account with delegated permissions in Active Directory and the actual user account that logs in here doesn&amp;rsquo;t have any permissions at all.&lt;/p&gt;
&lt;p&gt;This is the login screen:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2009/06/login.webp" class="glightbox" data-type="image" data-gallery="post-368"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/06/login-small.webp" alt="login" height="200" width="215" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;ve passed the login screen you enter the Main Console which consists of a Treeview on the left with possible options and a work area on the right:&lt;/p&gt;
&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/06/mainscreen.webp" alt="mainscreen" height="301" width="430" /&gt;</description></item><item><title>Modifying Microsoft Updates and/or hotfixes</title><link>https://remkoweijnen.nl/blog/2009/05/12/modifying-microsoft-updates-andor-hotfixes/</link><pubDate>Tue, 12 May 2009 13:53:34 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/05/12/modifying-microsoft-updates-andor-hotfixes/</guid><description>&lt;p&gt;As you might know Microsoft distributes updates and hotfixes with in installer, update.exe. When you run update.exe it looks into the supplied .inf files to see what it has to install. It&amp;rsquo;s not possible to make changes to the inf files however because that will invalidate it&amp;rsquo;s signature (and update.exe checks the signature that is stored in an accompanying .cat file).&lt;/p&gt;
&lt;p&gt;In my case I wanted to deploy the &lt;a href="http://www.microsoft.com/Downloads/details.aspx?familyid=F29D348A-78F9-47AD-92EB-632F9621BC84&amp;amp;displaylang=en" target="_blank"&gt;MUI pack for Internet Explorer 7&lt;/a&gt; to be able to support multiple languages. By default this pack installs 35 (!) languages and I wanted to install only Dutch language on top of existing English.&lt;/p&gt;</description></item><item><title>Unable to get System PTE individual lock consumer information error when using !sysptes 4 in WinDbg</title><link>https://remkoweijnen.nl/blog/2009/04/16/unable-to-get-system-pte-individual-lock-consumer-information-error-when-using-sysptes-4-in-windbg/</link><pubDate>Thu, 16 Apr 2009 16:07:07 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/04/16/unable-to-get-system-pte-individual-lock-consumer-information-error-when-using-sysptes-4-in-windbg/</guid><description>&lt;p&gt;A few days ago I was troubleshooting some strange problems on a Citrix Server. After some investigation (I will write about that later) it was clear to me that there was a shortage of System Page Table Entries (PTE&amp;rsquo;s). Using perfmon you can see how many free System PTE&amp;rsquo;s are available:&lt;/p&gt;
&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/04/perfcounter.webp" alt="perfcounter" height="212" width="215" /&gt;
&lt;p&gt;Any value below 5000 is not good, values below 2000 are critical. In my case it wasn&amp;rsquo;t possible to view processes with Task Manager anymore.&lt;/p&gt;
&lt;p&gt;Next I used WinDbg and attached to the Kernel (you can do that with File | Kernel Debug | Local | OK) and issued the !vm command:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2009/04/windbg.webp" class="glightbox" data-type="image" data-gallery="post-341"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/04/windbg-small.webp" alt="WinDbg" height="342" width="430" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;WinDbg shows us a warning that a lot of PTE allocations have failed, we can also see that there&amp;rsquo;s enough Paged Pool and Non Paged Pool available.&lt;/p&gt;
&lt;p&gt;So how do we find the guilty driver (usually it&amp;rsquo;s a driver)?&lt;/p&gt;</description></item><item><title>Sending Ctrl-Alt-Del / Simulate SAS in Windows Vista</title><link>https://remkoweijnen.nl/blog/2009/03/30/sending-ctrl-alt-del-simulate-sas-in-windows-vista/</link><pubDate>Mon, 30 Mar 2009 21:51:48 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/03/30/sending-ctrl-alt-del-simulate-sas-in-windows-vista/</guid><description>&lt;p&gt;Existing &lt;a href="https://remkoweijnen.nl/blog/2008/12/13/locking-a-workstation-part-1/"&gt;code&lt;/a&gt; to simulate the Secure Attention Sequence (SAS),which most people refer to as control alt delete or ctrl-alt-del, no longer works in Windows Vista. It seems that Microsoft offers a library that exports a function called SimulateSAS(). It is not public and one is supposed to request it by sending a mail to &lt;a href="mailto:saslib@microsoft.com"&gt;&lt;a href="mailto:saslib@microsoft.com"&gt;saslib@microsoft.com&lt;/a&gt;&lt;/a&gt;. Mails to this address remain unanswered though.&lt;/p&gt;</description></item><item><title>TSAdminEx Features Part 3</title><link>https://remkoweijnen.nl/blog/2009/02/25/tsadminex-features-part-3/</link><pubDate>Wed, 25 Feb 2009 13:08:31 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/02/25/tsadminex-features-part-3/</guid><description>&lt;table border="0" cellpadding="3" cellspacing="3" width="100%"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://remkoweijnen.nl/blog/2009/02/20/tsadminex-beta-release/"&gt;Beta Release&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://remkoweijnen.nl/blog/2009/02/23/tsadminex-features-part-1/"&gt;Part 1&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://remkoweijnen.nl/blog/2009/02/24/tsadminex-features-part-2/"&gt;Part 2&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
This is part 3 of the TSAdminEx Features series. Today I will discuss the Process View. As usual we will start by comparing TSAdmin to TSAdminEx again. So let's look at TSAdmin Process View:
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2009/02/tsadminprocess.webp" class="glightbox" data-type="image" data-gallery="post-320"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/02/tsadminprocess-small.webp" alt="TSAdminProcess" height="279" width="430" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And the one from TSAdminEx:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2009/02/tsadminexprocessview.webp" class="glightbox" data-type="image" data-gallery="post-320"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/02/tsadminexprocessview-small.webp" alt="TSAdminExProcessView" height="182" width="430" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>TSAdminEx Features Part 2</title><link>https://remkoweijnen.nl/blog/2009/02/24/tsadminex-features-part-2/</link><pubDate>Tue, 24 Feb 2009 10:17:07 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/02/24/tsadminex-features-part-2/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/2009/02/23/tsadminex-features-part-1"&gt;Part1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now that a &lt;a href="https://remkoweijnen.nl/blog/2009/02/20/tsadminex-beta-release/"&gt;TSAdminEx beta is ready&lt;/a&gt; I will be showing you some features. In this part I will show the Sessions View.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s start again with a compare of TSAdmin and TSAdminEx:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2009/02/tsadminsessionview.webp" class="glightbox" data-type="image" data-gallery="post-290"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/02/tsadminsessionview-small.webp" alt="TSAdminSessionView" height="177" width="430" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2009/02/tsadminexsessionview.webp" class="glightbox" data-type="image" data-gallery="post-290"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/02/tsadminexsessionview-small.webp" alt="TSAdminExSessionView" height="135" width="430" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As you can see TSAdminEx shows more details, it shows the following extra columns:&lt;/p&gt;</description></item><item><title>TSAdminEx Features Part 1</title><link>https://remkoweijnen.nl/blog/2009/02/23/tsadminex-features-part-1/</link><pubDate>Mon, 23 Feb 2009 16:18:28 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/02/23/tsadminex-features-part-1/</guid><description>&lt;p align="right"&gt;&lt;a href="https://remkoweijnen.nl/blog/2009/02/24/tsadminex-features-part-2/"&gt;Part 2&lt;/a&gt;&lt;/p&gt;
Now that a &lt;a href="https://remkoweijnen.nl/blog/2009/02/20/tsadminex-beta-release/" target="_blank"&gt;TSAdminEx beta is ready&lt;/a&gt; I will be showing you some features. In this part 1 I will be comparing the Users view to TSAdmin.
&lt;p&gt;Let&amp;rsquo;s start TSAdmin, this tool is present by default on Windows 2003. If you use Windows XP or Windows Vista you can get it by installing the &lt;a href="http://www.petri.co.il/download_windows_2003_r2_adminpak.htm" target="_blank"&gt;Administration Pack&lt;/a&gt;. Please note that TSAdmin does not work on Vista RTM due to a &lt;a href="https://remkoweijnen.nl/blog/2007/12/19/why-tsadmin-crashes-on-windows-vista/" target="_blank"&gt;bug&lt;/a&gt; that was &lt;a href="https://remkoweijnen.nl/blog/2008/03/02/vista-sp1-changes-to-terminal-server-api/" target="_blank"&gt;corrected in Vista SP1&lt;/a&gt; (TSAdminEx works fine on both RTM as well as SP1)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2009/02/tsadmin1.webp" class="glightbox" data-type="image" data-gallery="post-264"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/02/tsadmin1-small.webp" alt="TSAdmin1" height="159" width="430" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now let&amp;rsquo;s open TSAdminEx and start comparing&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2009/02/tsadminex1.webp" class="glightbox" data-type="image" data-gallery="post-264"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/02/tsadminex1-small.webp" alt="TSAdminEx1" height="156" width="430" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>TSAdminEx Beta release</title><link>https://remkoweijnen.nl/blog/2009/02/20/tsadminex-beta-release/</link><pubDate>Fri, 20 Feb 2009 17:59:06 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/02/20/tsadminex-beta-release/</guid><description>&lt;p&gt;Over the last months I have been working hard on TSAdminEx and now, finally, I can now present a first beta release.&lt;/p&gt;
&lt;p&gt;If you don&amp;rsquo;t know what TSAdminEx is let me briefly introduce it. TSAdminEx is a tool that combines functionality of several existing tools: it has the power of task manager combined with the details of Process Explorer and the Terminal Server support of TSAdmin. On top of that it fully supports remote systems out of the box without installing any agents or services. It also has some unique features that neither of the mentioned tools can do!&lt;/p&gt;
&lt;p&gt;Several new features have been implemented since the &lt;a href="https://remkoweijnen.nl/blog/2008/01/27/test-2/" target="_blank"&gt;last time I talked about TSAdminEx&lt;/a&gt; and I will show you the most exciting ones here:&lt;/p&gt;</description></item><item><title>Accessing kernel objects in other sessions part 1</title><link>https://remkoweijnen.nl/blog/2009/01/27/accessing-kernel-objects-in-other-sessions/</link><pubDate>Tue, 27 Jan 2009 19:43:52 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/01/27/accessing-kernel-objects-in-other-sessions/</guid><description>&lt;p&gt;As you know, many &lt;em&gt;kernel32.dll&lt;/em&gt; functions, which are working with named objects, like &lt;em&gt;OpenEvent&lt;/em&gt;, can be used to work with global and local objects. So what are global and local objects? Global objects are created in session 0 and are actually located in the &lt;strong&gt;\BaseNamedObjects&lt;/strong&gt; directory, while local objects are created in the caller&amp;rsquo;s session (for example in the &lt;strong&gt;\Sessions\5\BaseNamedObjects&lt;/strong&gt; directory (for session 0, global and local has no meaning since they point to the same object)). MSDN says that you can access only the objects in your own session(via the &lt;strong&gt;Local&amp;lt;/strong&amp;gt; prefix) and in session 0 (via the &lt;strong&gt;Global&amp;lt;/strong&amp;gt; prefix). But what if you need to access an object in another session?&lt;/p&gt;</description></item><item><title>Windows XP x64 Terminal Server Patch part 2 (optional)</title><link>https://remkoweijnen.nl/blog/2009/01/16/windows-xp-x64-terminal-server-patch-part-2-optional/</link><pubDate>Fri, 16 Jan 2009 00:32:05 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2009/01/16/windows-xp-x64-terminal-server-patch-part-2-optional/</guid><description>&lt;p&gt;In &lt;a href="https://remkoweijnen.nl/blog/2008/12/19/windows-xp-x64-terminal-server-patch-part-1-mandatory/"&gt;part 1&lt;/a&gt; I&amp;rsquo;ve showed how to get rid of some terminal server restrictions on Windows xp x64. But there are still some problems:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You cannot connect to the &lt;font color="#0080ff"&gt;localhost&lt;/font&gt; (&lt;font color="#0080ff"&gt;127.0.0.1&lt;/font&gt;) (but can to &lt;em&gt;127.a.b.c&lt;/em&gt;, where a,b,c in [0..255] (except &lt;font color="#0080ff"&gt;127.0.0.0&lt;/font&gt; and &lt;font color="#0080ff"&gt;127.255.255.255&lt;/font&gt;)).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When you&amp;rsquo;re connecting to remote server, Remote Desktop Connection (mstsc.exe) checks through mtscax.dll that you&amp;rsquo;re connecting to your own address, connections are only allowed and you&amp;rsquo;re in the server mode. If this is not true, the connection is denied, usually with this message: &lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2009/01/consolefailed.gif" class="glightbox" data-type="image" data-gallery="post-224"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2009/01/consolefailed-small.gif" alt="ConsoleFailed" height="22" width="130" /&gt;&lt;/a&gt;. The logic of checking is the same: call &lt;font color="blue"&gt;gethostbyname&lt;/font&gt; for server name and check if it&amp;rsquo;s not equal to &lt;font color="#0080ff"&gt;127.0.0.1&lt;/font&gt;.&lt;/p&gt;</description></item><item><title>Windows XP X64 Terminal Server patch part 1 (mandatory)</title><link>https://remkoweijnen.nl/blog/2008/12/19/windows-xp-x64-terminal-server-patch-part-1-mandatory/</link><pubDate>Fri, 19 Dec 2008 13:58:17 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/12/19/windows-xp-x64-terminal-server-patch-part-1-mandatory/</guid><description>&lt;p&gt;Windows XP X64 shares the same binaries with Windows 2003 X64, but Terminal Server has some restrictions on XP. This article shows you how to get rid of them and is based on cw2k ideas from the original Windows XP Terminal Server patch.&lt;/p&gt;
&lt;p&gt;&lt;font color="brown"&gt;Version 1.1 contains bug#1 fix and is smaller (less bytes are changed).&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;1) &lt;strong&gt;Winlogon.exe&lt;/strong&gt; contains a function, called &lt;font color="blue"&gt;EnumerateMatchingUsers&lt;/font&gt; which in turn calls &lt;font color="blue"&gt;IsProfessionalTerminalServer&lt;/font&gt; function. We need to patch this function to return zero (false):&lt;/p&gt;
&lt;p width="100%" style="border: 3px double #808080; overflow-x: scroll; white-space: nowrap; font-family: monospace"&gt; .text:0000000100042F77 IsProfessionalTerminalServer proc near &lt;span style="color: green"&gt;; CODE XREF: EnumerateMatchingUsers:loc_10002B44Bp&lt;/span&gt;&lt;span style="color: black"&gt;
.text:0000000100042F77 &lt;/span&gt; &lt;span style="color: #8080ff"&gt;; DATA XREF: .pdata:00000001000D01DCo ...&lt;/span&gt;&lt;span style="color: black"&gt;
.text:0000000100042F77&lt;/span&gt;&lt;span style="color: black"&gt;
.text:0000000100042F77 &lt;/span&gt; &lt;span style="color: green"&gt;VersionInformation&lt;/span&gt;&lt;span style="color: navy"&gt;= _OSVERSIONINFOW ptr&lt;/span&gt; &lt;span style="color: #008040"&gt;-138h&lt;/span&gt;&lt;span style="color: black"&gt;
.text:0000000100042F77 &lt;/span&gt; &lt;span style="color: green"&gt;var_20&lt;/span&gt; &lt;span style="color: navy"&gt;= word ptr&lt;/span&gt; &lt;span style="color: #008040"&gt;-20h&lt;/span&gt;&lt;span style="color: black"&gt;
.text:0000000100042F77 &lt;/span&gt; &lt;span style="color: green"&gt;var_ 1E&lt;/span&gt; &lt;span style="color: navy"&gt;= byte ptr&lt;/span&gt; &lt;span style="color: #008040"&gt;-1Eh&lt;/span&gt;&lt;span style="color: black"&gt;
.text:0000000100042F77 &lt;/span&gt; &lt;span style="color: green"&gt;var_18&lt;/span&gt; &lt;span style="color: navy"&gt;= qword ptr&lt;/span&gt; &lt;span style="color: #008040"&gt;-18h&lt;/span&gt;&lt;span style="color: black"&gt;
.text:0000000100042F77&lt;/span&gt;
&lt;span style="background: white none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: blue"&gt;&lt;span style="color: black"&gt;.text:0000000100042F77&lt;/span&gt; 48 81 EC 58 01 00 00 &lt;span style="color: navy"&gt;sub rsp&lt;/span&gt;&lt;span style="color: navy"&gt;,&lt;/span&gt; &lt;span style="color: green"&gt;158h &lt;font color="red"&gt;=&amp;gt; 31 C0 C3 xor eax, eax; retn&lt;/font&gt;&lt;/span&gt;
&lt;span style="color: black"&gt;.text:0000000100042F7E&lt;/span&gt; 48 8B 05 F3 3A 08 00 &lt;span style="color: navy"&gt;mov rax&lt;/span&gt;&lt;span style="color: navy"&gt;, cs:&lt;/span&gt;__security_cookie
&lt;span style="color: black"&gt;.text:0000000100042F85&lt;/span&gt; 48 89 84 24 40 01 00 00 &lt;span style="color: navy"&gt;mov [rsp+&lt;/span&gt;&lt;span style="color: green"&gt;158h&lt;/span&gt;&lt;span style="color: navy"&gt;+&lt;/span&gt;&lt;span style="color: green"&gt;var_18&lt;/span&gt;&lt;span style="color: navy"&gt;]&lt;/span&gt;&lt;span style="color: navy"&gt;, rax&lt;/span&gt;
&lt;span style="color: black"&gt;.text:0000000100042F8D&lt;/span&gt; 48 8D 4C 24 20 &lt;span style="color: navy"&gt;lea rcx&lt;/span&gt;&lt;span style="color: navy"&gt;, [rsp+&lt;/span&gt;&lt;span style="color: green"&gt;158h&lt;/span&gt;&lt;span style="color: navy"&gt;+&lt;/span&gt;&lt;span style="color: green"&gt;VersionInformation&lt;/span&gt;&lt;span style="color: navy"&gt;]&lt;/span&gt; ; void *
&lt;span style="color: black"&gt;.text:0000000100042F92&lt;/span&gt; 33 D2 &lt;span style="color: navy"&gt;xor edx&lt;/span&gt;&lt;span style="color: navy"&gt;, edx&lt;/span&gt; ; int&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;</description></item><item><title>Globally disable Flash Player autoupdate</title><link>https://remkoweijnen.nl/blog/2008/12/19/globally-disable-flash-player-autoupdate/</link><pubDate>Fri, 19 Dec 2008 09:06:16 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/12/19/globally-disable-flash-player-autoupdate/</guid><description>&lt;p&gt;On a Citrix or Terminal Server you will want to disable autoupdate notifications of the flash player.&lt;/p&gt;
&lt;p&gt;This can be done by creating a file mm.cfg in the folder where the flash ActiveX control is installed (normally C:\Windows\System32\Macromed\Flash).&lt;/p&gt;
&lt;p&gt;Place the following line in this file (with a text editor like Notepad):&lt;/p&gt;</description></item><item><title>Locking a workstation - part 1</title><link>https://remkoweijnen.nl/blog/2008/12/13/locking-a-workstation-part-1/</link><pubDate>Sat, 13 Dec 2008 23:13:08 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/12/13/locking-a-workstation-part-1/</guid><description>&lt;p&gt;Win32 API provides only 1 function for locking workstation, named &lt;strong&gt;LockWorkstation&lt;/strong&gt;. What does it do and how we can use it?&lt;/p&gt;
&lt;p&gt;When a new session is started, &lt;em&gt;smss.exe&lt;/em&gt; invokes &lt;em&gt;winlogon.exe&lt;/em&gt;. It registers its process id in &lt;em&gt;win32k.sys&lt;/em&gt; by calling &lt;strong&gt;RegisterLogonProcess&lt;/strong&gt;. It has this prototype:&lt;/p&gt;</description></item><item><title>Windows 2003 X64 Terminal Server Patch</title><link>https://remkoweijnen.nl/blog/2008/12/09/windows-2003-x64-terminal-server-patch/</link><pubDate>Tue, 09 Dec 2008 13:53:39 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/12/09/windows-2003-x64-terminal-server-patch/</guid><description>&lt;p&gt;A while ago I published a &lt;a href="https://remkoweijnen.nl/blog/2008/08/31/patch-windows-2003-terminal-server-to-allow-more-than-2-concurrent-sessions/"&gt;patch for Windows 2003 Terminal Server&lt;/a&gt; that allows more than 2 concurrent sessions in Remote Administration mode.&lt;/p&gt;
&lt;p&gt;Today I publish the same patch but for Windows Server 2003 X64. The patched function (CRAPolicy::Logon) is the same as in the original patch.&lt;/p&gt;</description></item><item><title>Executing a Fast User Switch programmatically - part 2</title><link>https://remkoweijnen.nl/blog/2008/11/26/executing-a-fast-user-switch-programmatically-part-2/</link><pubDate>Wed, 26 Nov 2008 16:45:46 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/11/26/executing-a-fast-user-switch-programmatically-part-2/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/2008/11/26/executing-a-fast-user-switch-programmatically-part-1/"&gt;Part1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s write our own Credential Server implementation.&lt;/p&gt;
&lt;p&gt;At first, we need to create a named pipe with a unique name. Let&amp;rsquo;s construct the pipe name using a GUID - this should be unique, but we can do it in a cycle to be absolutely sure:&lt;/p&gt;</description></item><item><title>Executing a Fast User Switch programmatically - part 1</title><link>https://remkoweijnen.nl/blog/2008/11/26/executing-a-fast-user-switch-programmatically-part-1/</link><pubDate>Wed, 26 Nov 2008 15:23:37 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/11/26/executing-a-fast-user-switch-programmatically-part-1/</guid><description>&lt;p&gt;I think many of you have got experience with multiple Terminal Server Sessions in windows XP, also called Fast User Switching (FUS). Let&amp;rsquo;s get inside this cool feature.&lt;/p&gt;
&lt;p&gt;How does FUS work? Each session has its own winlogon.exe. It draws the &lt;strong&gt;same&lt;/strong&gt; interface which looks like the screenshot below:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2008/11/default.webp"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2008/12/multiple-users-logged-on-2.webp" class="glightbox" data-type="image" data-gallery="post-149"&gt;&lt;img loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2008/12/multiple-users-logged-on-2-small.webp" alt="multiple-users-logged-on" height="320" width="430" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Terminal Server Internals</title><link>https://remkoweijnen.nl/blog/2008/11/19/terminal-server-internals/</link><pubDate>Wed, 19 Nov 2008 17:55:39 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/11/19/terminal-server-internals/</guid><description>&lt;p&gt;Hello, my name is Danila Galimov and i will write here sometimes :-)&lt;/p&gt;
&lt;p&gt;My first post is about communications between Terminal Server sessions and Terminal Server service process (termsrv.exe/dll). Terminal Server service needs to communicate with each session for many tasks, such as sending window message, getting message reply and so on. So, on init, Terminal Server creates a &lt;strong&gt;SmSsWinStationApiPort&lt;/strong&gt; port in global namespace and runs a few WinStationLpcThread threads, which are listening on port and are used to process port messages. When csrss.exe is started, it parses its command line, which usually looks like:&lt;/p&gt;
&lt;blockquote&gt;%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=4096,4096,1024 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=&lt;strong&gt;winsrv&lt;/strong&gt;&lt;em&gt;:UserServerDllInitialization,3 ServerDll&lt;/em&gt;=winsrv:&lt;em&gt;ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16&lt;/em&gt;&lt;/blockquote&gt;
and loads the required dlls (winsrv.dll in our case). Initialization of winsrv.dll creates a thread, which connects to &lt;strong&gt;SmSsWinStationApiPort&lt;/strong&gt; port and does the loop for processing Terminal Server messages until it receives WinStationTerminate message.
&lt;p&gt;We&amp;rsquo;ll try to fool Terminal Server&lt;/p&gt;</description></item><item><title>RDP Session with Local Taskbar visible</title><link>https://remkoweijnen.nl/blog/2008/11/02/rdp-session-with-local-taskbar-visible/</link><pubDate>Sun, 02 Nov 2008 08:16:42 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/11/02/rdp-session-with-local-taskbar-visible/</guid><description>&lt;p&gt;I usually have lots of Terminal Server sessions open when I&amp;rsquo;m working, both direct sessions but also &amp;ldquo;sessions in sessions&amp;rdquo;. In order to keep overview on my desktop I prefer to make the session size as big as possible without being full screen (so keep my local taskbar visible).&lt;/p&gt;
&lt;img loading="lazy" decoding="async" width="404" src="https://remkoweijnen.nl/blog/wp-content/uploads/2008/11/localtaskbar2.webp" alt="LocalTaskBar2" height="242" /&gt;
&lt;p&gt;If I run a session in a session I do this again, this makes switching sessions very easy and you can always see which session you are in:&lt;/p&gt;</description></item><item><title>Patch Windows 2008 Terminal Server to allow more than 2 concurrent sessions</title><link>https://remkoweijnen.nl/blog/2008/10/21/patch-windows-2008-terminal-server-to-allow-more-than-2-concurrent-sessions/</link><pubDate>Tue, 21 Oct 2008 13:56:23 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/10/21/patch-windows-2008-terminal-server-to-allow-more-than-2-concurrent-sessions/</guid><description>&lt;p&gt;Well it took some time but I patched Terminal Server for Windows 2008 to allow unlimited sessions in Remote Administration mode.&lt;/p&gt;
&lt;p&gt;This patch is for 32 bit English version. In order to install it you need to perform the steps below. Before you start please check if using this patch is allowed according to your country&amp;rsquo;s law and your license agreement.&lt;/p&gt;</description></item><item><title>Patch Windows 2003 Terminal Server to allow more than 2 concurrent sessions</title><link>https://remkoweijnen.nl/blog/2008/08/31/patch-windows-2003-terminal-server-to-allow-more-than-2-concurrent-sessions/</link><pubDate>Sun, 31 Aug 2008 07:19:48 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/08/31/patch-windows-2003-terminal-server-to-allow-more-than-2-concurrent-sessions/</guid><description>&lt;p&gt;As you might know Windows 2003 Server accepts at most 2 concurrent Terminal Server sessions (and 1 console session) in Remote Administration mode (which is the default). Of course if you switch to Application Mode you can have an unlimited number of sessions but this requires licenses and a license server.&lt;/p&gt;
&lt;p&gt;When Terminal Server creates a new session it checks if the new session is either a console session or a help assistant session and if not it allocates a license. The function that performs this check is called CRAPolicy::Logon&lt;/p&gt;</description></item><item><title>Multiple Concurrent Terminal Server Sessions On Vista SP1</title><link>https://remkoweijnen.nl/blog/2008/06/14/mutiple-concurrent-terminal-session-on-vista-sp1/</link><pubDate>Sat, 14 Jun 2008 23:35:44 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/06/14/mutiple-concurrent-terminal-session-on-vista-sp1/</guid><description>&lt;p&gt;There are several patched terminal server dll&amp;rsquo;s floating around in the net to allow multiple concurrent Terminal Server session on Windows Vista with Service Pack 1. But they all have the same limitations:&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s not possible to start a session to Localhost, this is because the Terminal Server client does a check to see if you are running Personal Terminal Server (Vista/XP) and denies Localhost or 127.0.0.1 if true (127.0.0.2 works though).&lt;/p&gt;</description></item><item><title>Terminal Server Ping Tool</title><link>https://remkoweijnen.nl/blog/2008/06/13/terminal-server-ping-tool/</link><pubDate>Fri, 13 Jun 2008 13:34:46 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/06/13/terminal-server-ping-tool/</guid><description>&lt;p&gt;A while ago I included a new undocumented API into my JwaWinsta unit which is called WinStationServerPing. This API &amp;ldquo;pings&amp;rdquo; a Terminal or Citrix server and verifies that Terminal Server is up and running. It is not the same as a regular networking ping! This API actually makes a connection to a (remote) Terminal Server and verifies that Terminal Server runs and accepts connections.&lt;/p&gt;
&lt;p&gt;I wrote a small cmdline tool that uses this API to ping a Terminal Server which can be used to quickly determine if a Terminal Server is up and running. I named it WTSPing.&lt;/p&gt;
&lt;p&gt;So how does it work? Open up a command prompt (Start -&amp;gt; Run -&amp;gt; cmd) and type WTSPing /? to see the help:&lt;/p&gt;</description></item><item><title>How rdp passwords are encrypted 2</title><link>https://remkoweijnen.nl/blog/2008/03/02/how-rdp-passwords-are-encrypted-2/</link><pubDate>Sun, 02 Mar 2008 23:28:57 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/03/02/how-rdp-passwords-are-encrypted-2/</guid><description>&lt;p&gt;Several months ago I &lt;a href="https://remkoweijnen.nl/blog/2007/10/18/how-rdp-passwords-are-encrypted/"&gt;wrote&lt;/a&gt; about encrypting and decrypting RDP passwords. I left one thing open: encrypting the password up to the full 1329 bytes as mstsc does.&lt;/p&gt;
&lt;p&gt;Many people were curious about it so I hope the answer is not a disappointment because it&amp;rsquo;s actually really simple (but I took me a while to figure that out nonetheless). In what I figure is an attempt to hide the password length mstsc always fills up the password with zeroes until it has 512 bytes length.&lt;/p&gt;</description></item><item><title>Vista SP1 changes to Terminal Server API</title><link>https://remkoweijnen.nl/blog/2008/03/02/vista-sp1-changes-to-terminal-server-api/</link><pubDate>Sun, 02 Mar 2008 15:31:55 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/03/02/vista-sp1-changes-to-terminal-server-api/</guid><description>&lt;p&gt;In a previous &lt;a href="https://remkoweijnen.nl/blog/2007/12/19/why-tsadmin-crashes-on-windows-vista/"&gt;article&lt;/a&gt; I wrote about changes in utildll in vista that breaked compatibality for Terminal Server. Even though release notes for Service Pack 1 don&amp;rsquo;t indicate changes or fixes in this area my testing shows that Microsoft has taken over the Windows 2008 implementation of utildll to Vista.&lt;/p&gt;</description></item><item><title>Supporting for in loop in TObjectList descendants</title><link>https://remkoweijnen.nl/blog/2008/03/02/supporting-for-in-loop-in-tobjectlist-descendants/</link><pubDate>Sun, 02 Mar 2008 15:08:19 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/03/02/supporting-for-in-loop-in-tobjectlist-descendants/</guid><description>&lt;p&gt;For my Terminal Server unit in the Jedi Security library I use 2 TObjectList descendants to hold a list of Terminal Server Sessions and Processes. Consider the sample below which connects to a server and enumerates all sessions:&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;span class="codelang"&gt;objectpascal&lt;/span&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".pas" href="data:text/plain;charset=utf-8;base64,dmFyCiAgQVRlcm1pbmFsU2VydmVyOiBUSndUZXJtaW5hbFNlcnZlcjsKICBpOiBJbnRlZ2VyOwpiZWdpbgogIEFUZXJtaW5hbFNlcnZlciA6PSBUandUZXJtaW5hbFNlcnZlci5DcmVhdGU7CgogIEFUZXJtaW5hbFNlcnZlci5TZXJ2ZXIgOj0gJ1RTMDAxJzsKCiAgdHJ5CiAgICBpZiBBVGVybWluYWxTZXJ2ZXIuRW51bWVyYXRlU2Vzc2lvbnMgdGhlbgogICAgYmVnaW4KCiAgICAgIC8vIE5vdyBsb29wIHRocm91Z2ggdGhlIGxpc3QKICAgICAgZm9yIGkgOj0gMCB0byBBVGVybWluYWxTZXJ2ZXIuU2Vzc2lvbnMuQ291bnQgLSAxIGRvCiAgICAgIGJlZ2luCiAgICAgICAgTWVtbzEuTGluZXMuQWRkKEFUZXJtaW5hbFNlcnZlci5TZXNzaW9uc1tpXS5Vc2VybmFtZSk7CiAgICAgIGVuZDsKCiAgICBlbmQ7CiAgZXhjZXB0CiAgICBvbiBFOiBFSndzY2xXaW5DYWxsRmFpbGVkRXhjZXB0aW9uIGRvCiAgICBiZWdpbgogICAgICAvLyBIYW5kbGUgRXhjZXB0aW9uIGhlcmUKICAgIGVuZDsKICBlbmQ7CgogIC8vIEZyZWUgTWVtb3J5CiAgQVRlcm1pbmFsU2VydmVyLkZyZWU7CmVuZDs="&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-objectpascal" data-lang="objectpascal"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;var&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;ATerminalServer&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TJwTerminalServer&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;i&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;ATerminalServer&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TjwTerminalServer&lt;span class="p"&gt;.&lt;/span&gt;Create&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;ATerminalServer&lt;span class="p"&gt;.&lt;/span&gt;Server&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#39;TS001&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;try&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ATerminalServer&lt;span class="p"&gt;.&lt;/span&gt;EnumerateSessions&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// Now loop through the list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;i&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ATerminalServer&lt;span class="p"&gt;.&lt;/span&gt;Sessions&lt;span class="p"&gt;.&lt;/span&gt;Count&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;Memo1&lt;span class="p"&gt;.&lt;/span&gt;Lines&lt;span class="p"&gt;.&lt;/span&gt;Add&lt;span class="o"&gt;(&lt;/span&gt;ATerminalServer&lt;span class="p"&gt;.&lt;/span&gt;Sessions&lt;span class="p"&gt;[&lt;/span&gt;i&lt;span class="p"&gt;].&lt;/span&gt;Username&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;except&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;E&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;EJwsclWinCallFailedException&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// Handle Exception here&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// Free Memory&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;ATerminalServer&lt;span class="p"&gt;.&lt;/span&gt;Free&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
In the sample I loop through the sessions with a for loop. Even though Delphi supports the for in loop since Delphi 2005 it's not possible to use this in TObjectList descendants, so we cannot use this:
&lt;br&gt;
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;span class="codelang"&gt;objectpascal&lt;/span&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".pas" href="data:text/plain;charset=utf-8;base64,Ly8gTm93IGxvb3AgdGhyb3VnaCB0aGUgbGlzdApmb3IgU2Vzc2lvbiBpbiBBVGVybWluYWxTZXJ2ZXIuU2Vzc2lvbkxpc3QgZG8KYmVnaW4KICBNZW1vMS5MaW5lcy5BZGQoU2Vzc2lvbi5Vc2VybmFtZSk7CmVuZDs="&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-objectpascal" data-lang="objectpascal"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Now loop through the list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Session&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ATerminalServer&lt;span class="p"&gt;.&lt;/span&gt;SessionList&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;Memo1&lt;span class="p"&gt;.&lt;/span&gt;Lines&lt;span class="p"&gt;.&lt;/span&gt;Add&lt;span class="o"&gt;(&lt;/span&gt;Session&lt;span class="p"&gt;.&lt;/span&gt;Username&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
To make this possible we need to implement GetEnumerator and an Enumerator class:
&lt;br&gt;
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;span class="codelang"&gt;objectpascal&lt;/span&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".pas" href="data:text/plain;charset=utf-8;base64,VEp3U2Vzc2lvbnNFbnVtZXJhdG9yID0gY2xhc3MKcHJpdmF0ZQogIEZJbmRleDogSW50ZWdlcjsKICBGU2Vzc2lvbnM6IFRKd1dUU1Nlc3Npb25MaXN0OwpwdWJsaWMKICBjb25zdHJ1Y3RvciBDcmVhdGUoQVNlc3Npb25MaXN0OiBUSndXVFNTZXNzaW9uTGlzdCk7CiAgZnVuY3Rpb24gR2V0Q3VycmVudDogVEp3V1RTU2Vzc2lvbjsKICBmdW5jdGlvbiBNb3ZlTmV4dDogQm9vbGVhbjsKICBwcm9wZXJ0eSBDdXJyZW50OiBUSndXVFNTZXNzaW9uIHJlYWQgR2V0Q3VycmVudDsKZW5kOwoKY29uc3RydWN0b3IgVEp3U2Vzc2lvbnNFbnVtZXJhdG9yLkNyZWF0ZShBU2Vzc2lvbkxpc3Q6IFRKd1dUU1Nlc3Npb25MaXN0KTsKYmVnaW4KICBpbmhlcml0ZWQgQ3JlYXRlOwogIEZJbmRleCA6PSAtMTsKICBGU2Vzc2lvbnMgOj0gQVNlc3Npb25MaXN0OwplbmQ7CgpmdW5jdGlvbiBUSndTZXNzaW9uc0VudW1lcmF0b3IuR2V0Q3VycmVudDsKYmVnaW4KICBSZXN1bHQgOj0gRlNlc3Npb25zW0ZJbmRleF07CmVuZDsKCmZ1bmN0aW9uIFRKd1Nlc3Npb25zRW51bWVyYXRvci5Nb3ZlTmV4dDogQm9vbGVhbjsKYmVnaW4KICBSZXN1bHQgOj0gRkluZGV4IDwgRlNlc3Npb25zLkNvdW50IC0gMTsKICBpZiBSZXN1bHQgdGhlbgogICAgSW5jKEZJbmRleCk7CmVuZDs="&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-objectpascal" data-lang="objectpascal"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;TJwSessionsEnumerator&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;class&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;private&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;FIndex&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;FSessions&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TJwWTSSessionList&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;public&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;constructor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Create&lt;span class="o"&gt;(&lt;/span&gt;ASessionList&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TJwWTSSessionList&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;GetCurrent&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TJwWTSSession&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;MoveNext&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;property&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Current&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TJwWTSSession&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;read&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;GetCurrent&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;constructor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TJwSessionsEnumerator&lt;span class="p"&gt;.&lt;/span&gt;Create&lt;span class="o"&gt;(&lt;/span&gt;ASessionList&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TJwWTSSessionList&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;inherited&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Create&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;FIndex&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;FSessions&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ASessionList&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TJwSessionsEnumerator&lt;span class="p"&gt;.&lt;/span&gt;GetCurrent&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ge"&gt;Result&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;FSessions&lt;span class="p"&gt;[&lt;/span&gt;FIndex&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TJwSessionsEnumerator&lt;span class="p"&gt;.&lt;/span&gt;MoveNext&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ge"&gt;Result&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;FIndex&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;FSessions&lt;span class="p"&gt;.&lt;/span&gt;Count&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ge"&gt;Result&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;Inc&lt;span class="o"&gt;(&lt;/span&gt;FIndex&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
Now we add a function with the name GetEnumerator in the SessionList class:
&lt;br&gt;
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;span class="codelang"&gt;objectpascal&lt;/span&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".pas" href="data:text/plain;charset=utf-8;base64,ZnVuY3Rpb24gVEp3V1RTU2Vzc2lvbkxpc3QuR2V0RW51bWVyYXRvcjogVEp3U2Vzc2lvbnNFbnVtZXJhdG9yOwpiZWdpbgogIFJlc3VsdCA6PSBUSndTZXNzaW9uc0VudW1lcmF0b3IuQ3JlYXRlKFNlbGYpOwplbmQ7"&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-objectpascal" data-lang="objectpascal"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TJwWTSSessionList&lt;span class="p"&gt;.&lt;/span&gt;GetEnumerator&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TJwSessionsEnumerator&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ge"&gt;Result&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TJwSessionsEnumerator&lt;span class="p"&gt;.&lt;/span&gt;Create&lt;span class="o"&gt;(&lt;/span&gt;Self&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
And that's really all!
&lt;section class="comments"&gt;
&lt;h2&gt;1 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;&lt;a href="http://blog.delphi-jedi.net/2008/03/03/remko-shows-us-how-to-use-the-terminal-server-feature-of-jwscl/" rel="nofollow ugc"&gt;&amp;amp;nbsp; Remko shows us how to use the Terminal Server feature of JWSCL&amp;amp;nbsp;by&amp;amp;nbsp;JEDI Windows API&lt;/a&gt;&lt;/span&gt; &lt;time datetime="2008-03-03"&gt;Mar 3, 2008&lt;/time&gt;&lt;/div&gt;&lt;div class="comment-body"&gt;&lt;p&gt;[...] Go and learn more about it here. [...]&lt;/p&gt;</description></item><item><title>TSAdminEx Progress</title><link>https://remkoweijnen.nl/blog/2008/01/27/test-2/</link><pubDate>Sun, 27 Jan 2008 23:04:07 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/01/27/test-2/</guid><description>&lt;p&gt;I just wanted to show some of the progress that I made in development of TSAdminEx. I thought the best way would be to show some screenshots. Which reminds me I installed a nice Javascript to enlarge the thumbnails, click to see it&amp;hellip;&lt;/p&gt;</description></item><item><title>Using WTSWaitSystemEvent</title><link>https://remkoweijnen.nl/blog/2008/01/25/using-wtswaitsystemevent/</link><pubDate>Fri, 25 Jan 2008 18:02:13 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2008/01/25/using-wtswaitsystemevent/</guid><description>&lt;p&gt;If you develop an application for Terminal Server you might want to react on session events. This means that your application is notified when a user logs on, logs off or becomes idle. This can be done with the &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/aa383856(VS.85).aspx"&gt;WTSWaitSystemEvent&lt;/a&gt; function. Implementing it is rather simple and could look something like this:&lt;/p&gt;</description></item><item><title>Why TSAdmin crashes on Windows Vista</title><link>https://remkoweijnen.nl/blog/2007/12/19/why-tsadmin-crashes-on-windows-vista/</link><pubDate>Wed, 19 Dec 2007 21:38:39 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/12/19/why-tsadmin-crashes-on-windows-vista/</guid><description>&lt;p&gt;Have you ever tried running the Terminal Server Administration tool (aka TSAdmin) on Windows Vista? You would need it to remotely administer windows 2000/2003 Terminal Servers. If you try to run it you will get an Access Violation but why? I found the answer to this question today because I was testing my &lt;a target="_blank" href="https://remkoweijnen.nl/blog/2007/10/23/tsadminex/"&gt;TSAdmin replacement &lt;/a&gt;on different Windows versions. Just like TSAdmin I use an (undocumented) function from Utildll.dll called ElapsedTimeString. It&amp;rsquo;s a very simple function that returns a formatted elapsed time string (as seen in the Idle time column from TSAdmin).&lt;/p&gt;</description></item><item><title>Undocumented API's from Utildll</title><link>https://remkoweijnen.nl/blog/2007/12/09/undocumented-apis-from-utildll/</link><pubDate>Sun, 09 Dec 2007 11:05:04 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/12/09/undocumented-apis-from-utildll/</guid><description>&lt;p&gt;Several of Microsoft&amp;rsquo;s Terminal Server tools use undocumented API&amp;rsquo;s from Utildll.dll. For instance Terminal Server Admin uses it to get a localised connect state string and to format time strings like idle time, logon time etc.&lt;/p&gt;
&lt;p&gt;Functions below seems to be the most usefull ones, I will add those to the JwaWinsta unit:&lt;/p&gt;</description></item><item><title>Delphi and Terminal Server Aware</title><link>https://remkoweijnen.nl/blog/2007/11/24/delphi-and-terminal-server-aware/</link><pubDate>Sat, 24 Nov 2007 23:21:37 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/11/24/delphi-and-terminal-server-aware/</guid><description>&lt;p&gt;When an application is not Terminal Server aware (also known as a legacy application), Terminal Server makes certain modifications to the legacy application to make it work properly in a multiuser environment. For example, Terminal Server will create a virtual Windows folder, such that each user gets a Windows folder instead of getting the system&amp;rsquo;s Windows directory. This gives users access to their own INI files. In addition, Terminal Server makes some adjustments to the registry for a legacy application. These modifications slow the loading of the legacy application on Terminal Server and require up to 8 MegaBytes extra memory. This behaviour can be avoided if the TSAware flag is present in the PE header of an executable as can be read &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/microsoft.visualstudio.vcprojectengine.vclinkertool.terminalserveraware(VS.80).aspx"&gt;here&lt;/a&gt; at MSDN.&lt;/p&gt;</description></item><item><title>Multiple Terminal Sessions in Windows Vista</title><link>https://remkoweijnen.nl/blog/2007/11/21/multiple-terminal-session-in-windows-vista/</link><pubDate>Wed, 21 Nov 2007 18:09:47 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/11/21/multiple-terminal-session-in-windows-vista/</guid><description>&lt;p&gt;There were 2 ways (known to me) of extending Windows XP to offer mulitple concurrent Terminal Sessions. One with the RC1 version of XP SP2 and one that patches Winlogon and Termsrv.dll. The latter offers not only multiple sessions but also multiple sessions under the same account and sessions to the local machine.&lt;/p&gt;</description></item><item><title>More undocumented Terminal Server API's</title><link>https://remkoweijnen.nl/blog/2007/11/09/more-undocumented-terminal-server-apis/</link><pubDate>Fri, 09 Nov 2007 22:42:58 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/11/09/more-undocumented-terminal-server-apis/</guid><description>&lt;p&gt;I added some more undocumented API&amp;rsquo;s to my Jwawinsta unit, the unit is now becoming a collection of the undocumented API&amp;rsquo;s in winsta.dll.&lt;/p&gt;
&lt;p&gt;These are the functions I added:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;WinStationDisconnect&lt;/li&gt;
	&lt;li&gt;WinStationGetProcessSid&lt;/li&gt;
	&lt;li&gt;CachedGetUserFromSid (exported by utildll.dll)&lt;/li&gt;
&lt;/ul&gt;
I also added some more parts of the undocumented structure returned by WinStationQueryInformationW, it now contains:
&lt;ul&gt;
	&lt;li&gt;Session State&lt;/li&gt;
	&lt;li&gt;WinStationName&lt;/li&gt;
	&lt;li&gt;SessionId&lt;/li&gt;
	&lt;li&gt;ConnectTime&lt;/li&gt;
	&lt;li&gt;DisconnectTime&lt;/li&gt;
	&lt;li&gt;LastInputTime&lt;/li&gt;
	&lt;li&gt;LogonTime&lt;/li&gt;
	&lt;li&gt;OutgoingFrames&lt;/li&gt;
	&lt;li&gt;OutgoingBytes&lt;/li&gt;
	&lt;li&gt;OutgoingCompressedBytes&lt;/li&gt;
	&lt;li&gt;IncomingCompressedBytes&lt;/li&gt;
	&lt;li&gt;IncomingFrames&lt;/li&gt;
	&lt;li&gt;IncomingBytes&lt;/li&gt;
	&lt;li&gt;Domain&lt;/li&gt;
	&lt;li&gt;Username&lt;/li&gt;
	&lt;li&gt;CurrentTime&lt;/li&gt;
&lt;/ul&gt;
&lt;section class="comments"&gt;
&lt;h2&gt;2 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;Chris&lt;/span&gt; &lt;time datetime="2007-12-03"&gt;Dec 3, 2007&lt;/time&gt;&lt;/div&gt;&lt;div class="comment-body"&gt;&lt;p&gt;I would like know how it is possible to access WindowStation and Desktops from a service.&lt;br&gt;
CreateDesktop and similar only works for the current session of the process.&lt;br&gt;
I know there exists NTQueryObject and similar but they are hard to understand and only query kernel objects.&lt;br&gt;
However creating a desktop from a service into another session is a mystery.&lt;/p&gt;</description></item><item><title>Terminal Server Client annoyances</title><link>https://remkoweijnen.nl/blog/2007/11/09/terminal-server-client-annoyances/</link><pubDate>Fri, 09 Nov 2007 21:39:50 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/11/09/terminal-server-client-annoyances/</guid><description>&lt;p&gt;If you want to get rid of this message: &lt;/p&gt;
&lt;p&gt;Remote Desktop cannot verify the identity of the computer you want to connect to.  This problem can occur if:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The remote computer is running a version of Windows that is earlier than Windows Vista.&lt;/li&gt;
&lt;li&gt;The remote computer is configured to support only the RDP security layer.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Contact your network administrator or the owner of the remote computer for assistance.&lt;/p&gt;</description></item><item><title>Citrix Solutions Conference 2007</title><link>https://remkoweijnen.nl/blog/2007/11/08/citrix-solutions-conference-2007/</link><pubDate>Thu, 08 Nov 2007 15:01:24 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/11/08/citrix-solutions-conference-2007/</guid><description>&lt;p&gt;Yesterday I attended the Citrix Solutions Conference in Antwerp. Brad Pedersen (Chief Architect and Senior Fellow at  Citrix Systems) held an interesting speech about &lt;a target="_blank" href="http://www.citrix-eventservice.com/et/citrix/et/e/2007/01/1/m/be/agenda/popup/the_end_user_experience.html"&gt;The End User Experience&lt;/a&gt;. I liked especially liked the part about the history of Citrix and the early versions of their products like Wincredible and Winframe. Since Brad wrote the original code for Citrix and thus Terminal Server (the stuff that is in winsta.dll now) I hoped he could share some info with me on the undiscovered parts of winsta.dll. Unfortunately Brad could not do this because of a non disclosure agreement with Microsoft. He did tell me that Citrix is pushing Microsoft to make more Terminal Server API&amp;rsquo;s public. I presume that&amp;rsquo;s why Vista and Windows 2008 offer some new API&amp;rsquo;s which I wrote about &lt;a href="https://remkoweijnen.nl/blog/2007/10/30/new-terminal-server-apis-in-vista-sp1"&gt;earlier&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>How to launch a process in a Terminal Session #2</title><link>https://remkoweijnen.nl/blog/2007/11/08/how-to-launch-a-process-in-a-terminal-session-2/</link><pubDate>Thu, 08 Nov 2007 13:48:18 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/11/08/how-to-launch-a-process-in-a-terminal-session-2/</guid><description>&lt;p&gt;&lt;img width="48" height="48" loading="lazy" decoding="async" align="right" src="https://remkoweijnen.nl/blog/wp-content/uploads/2007/11/cmd.webp" alt="Command Prompt Icon" /&gt;A little while ago I wrote an article on launching a process in another Terminal Session (&lt;a href="https://remkoweijnen.nl/blog/2007/10/20/how-to-launch-a-process-in-a-terminal-session/"&gt;/2007/10/20/how-to-launch-a-process-in-a-terminal-session/&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The article didn&amp;rsquo;t have a demo app yet so I&amp;rsquo;ve attached it here.&lt;/p&gt;</description></item><item><title>How to get Client IP Address?</title><link>https://remkoweijnen.nl/blog/2007/10/31/how-to-get-client-ip-address/</link><pubDate>Wed, 31 Oct 2007 11:10:10 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/10/31/how-to-get-client-ip-address/</guid><description>&lt;p&gt;When a client is connected to a Terminal Server Session you can use the Terminal Server API to retrieve the client&amp;rsquo;s local IP address.&lt;/p&gt;
&lt;p&gt;Start by enumerating all sessions with &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/aa383833.aspx"&gt;WtsEnumerateSessions&lt;/a&gt; and then for each session get the ClientAddress with a call to &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/aa383838.aspx"&gt;WTSQuerySessionInformation&lt;/a&gt; with the WTSClientAddress parameter. Sound simple, no?&lt;/p&gt;
&lt;p&gt;WTSQuerySessionInformation returns a pointer to a &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/aa383857.aspx"&gt;WTS_CLIENT_ADDRESS&lt;/a&gt; structure. You need to know that the IP address is located at on &lt;em&gt;offset of 2 bytes&lt;/em&gt; in the Address member of WTS_CLIENT_ADDRESS.&lt;/p&gt;
&lt;p&gt;So here&amp;rsquo;s a sample:&lt;/p&gt;</description></item><item><title>New Terminal Server API's in Vista SP1</title><link>https://remkoweijnen.nl/blog/2007/10/30/new-terminal-server-apis-in-vista-sp1/</link><pubDate>Tue, 30 Oct 2007 22:19:25 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/10/30/new-terminal-server-apis-in-vista-sp1/</guid><description>&lt;p&gt;The upcoming Vista SP1 promises 3 new Terminal Server API functions:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/bb394782.aspx"&gt;WTSConnectSession &lt;/a&gt;: Connects a Terminal Services session to an existing session on the local computer.&lt;/li&gt;
	&lt;li&gt;&lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/bb394783.aspx"&gt;WTSStartRemoteControlSession&lt;/a&gt;: Starts the remote control of another Terminal Services session.&lt;/li&gt;
	&lt;li&gt;&lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/bb394784.aspx"&gt;WTSStopRemoteControlSession &lt;/a&gt;: Stops a remote control session.&lt;/li&gt;
&lt;/ul&gt;
If you look in the Windows 2008 beta you can see that the functions are already implemented (in WtsApi32.dll):</description></item><item><title>RDP Clipboard Fix</title><link>https://remkoweijnen.nl/blog/2007/10/25/rdp-clipboard-fix/</link><pubDate>Thu, 25 Oct 2007 17:45:57 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/10/25/rdp-clipboard-fix/</guid><description>&lt;p&gt;Did you ever loose Clipboard functionality (copy/paste) while working with several Terminal Server sessions? I think everyone that works a lot with Terminal Server has experienced this from time to time.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s caused by badly behaving applications. Dimitry Vostokov wrote a tool to fix this issue for Citrix (RepairCBDChain.exe), he explains the issue very well on his blog:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Windows has a mechanism to notify applications about clipboard changes. An application interested in such notifications has to register itself in the so called clipboard chain. Windows inserts it on top of that chain and that application is responsible to propagate changes down the chain:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://citrite.org/blogs/dmitryv/files/2006/12/rc1.JPG"&gt;&lt;em&gt;&lt;img src="http://citrite.org/blogs/dmitryv/files/2006/12/rc1.thumbnail.JPG" alt="rc1.JPG" height="80" /&gt;&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;If 3rd-party application forgets to forward notifications down then we have a broken clipboard chain and clipboard changes are not sent via ICA protocol:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Read more at Dimitry&amp;rsquo;s Blog: &lt;a href="http://citrite.org/blogs/dmitryv/2006/12/09/clipboard-issues-explained/"&gt;&lt;a href="http://citrite.org/blogs/dmitryv/2006/12/09/clipboard-issues-explained/"&gt;http://citrite.org/blogs/dmitryv/2006/12/09/clipboard-issues-explained/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So how can we fix this for Terminal Server then?&lt;/p&gt;</description></item><item><title>TSAdminEx</title><link>https://remkoweijnen.nl/blog/2007/10/23/tsadminex/</link><pubDate>Tue, 23 Oct 2007 19:48:50 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/10/23/tsadminex/</guid><description>&lt;p&gt;You will probably know Microsofts Tool to Manage Terminal Server, it&amp;rsquo;s called Terminal Services Manager (you will probably know it as TSAdmin). It can be used to view information about terminal servers including all sessions, users, and processes for each terminal server.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2007/10/tsadmin1.webp" title="TSAdmin Screenshot" class="glightbox" data-type="image" data-gallery="post-32"&gt;&lt;img width="128" height="67" loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2007/10/tsadmin.thumbnail1.webp" alt="TSAdmin Screenshot" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m currently working on a TSAdmin replacement (codename TSAdminEx). Purpose is to show how to use the Terminal Server API&amp;rsquo;s and as a little bonus we will add some extra functionality to TSAdminEx.&lt;/p&gt;</description></item><item><title>How to launch a process in a Terminal Session</title><link>https://remkoweijnen.nl/blog/2007/10/20/how-to-launch-a-process-in-a-terminal-session/</link><pubDate>Sat, 20 Oct 2007 22:45:24 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/10/20/how-to-launch-a-process-in-a-terminal-session/</guid><description>&lt;p&gt;This is an often asked question but the solution is simple:&lt;/p&gt;
&lt;p&gt;So how does it work?&lt;br&gt;
First we obtain the user&amp;rsquo;s primary access token with the &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/aa383840.aspx"&gt;WtsQueryUserToken &lt;/a&gt; API call. To call this function successfully, the calling application must be running within the context of the LocalSystem account and have the SE_TCB_NAME privilege (LocalSystem has this privilege by default). Since the function returns a primary acces token we can just pass this to CreateProcessAsUser and voila!&lt;/p&gt;</description></item><item><title>How rdp passwords are encrypted</title><link>https://remkoweijnen.nl/blog/2007/10/18/how-rdp-passwords-are-encrypted/</link><pubDate>Thu, 18 Oct 2007 21:23:17 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/10/18/how-rdp-passwords-are-encrypted/</guid><description>&lt;p&gt;&lt;img width="48" height="48" loading="lazy" decoding="async" align="right" src="https://remkoweijnen.nl/blog/wp-content/uploads/2007/10/mstsc1.webp" alt="mstsc icon" /&gt; Ever wondered how mstsc saves passwords? If you open an RDP file with a text editor like Notepad you can see the encrypted password. In this article I will show you how to encrypt and decrypt these passwords. Besides password recovery this enables you to create rpd files programmatically or perhaps update the password in many rdp files with a batch file.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2007/10/rdpscreenshot1.webp" title="RDP Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Launch RDP from commandline</title><link>https://remkoweijnen.nl/blog/2007/10/17/launch-rdp-from-commandline/</link><pubDate>Wed, 17 Oct 2007 22:47:53 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2007/10/17/launch-rdp-from-commandline/</guid><description>&lt;p&gt;&lt;img width="48" height="48" loading="lazy" decoding="async" src="https://remkoweijnen.nl/blog/wp-content/uploads/2007/10/cmd1.webp" alt="Command Prompt Icon" align="right" /&gt;A little while ago I wrote a little commandline tool that starts an RDP connection (with mstsc.exe) because mstsc doesn&amp;rsquo;t allow you to use the login credentials (username, password) as commandline arguments.&lt;/p&gt;
&lt;p&gt;Arguments are:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Servername (string)&lt;/li&gt;
	&lt;li&gt;Port (integer, usually 3389)&lt;/li&gt;
	&lt;li&gt;Username (string)&lt;/li&gt;
	&lt;li&gt;Domain (string)&lt;/li&gt;
	&lt;li&gt;Password (string)&lt;/li&gt;
	&lt;li&gt;Console (integer, specify 0 for false and 1 for true)&lt;/li&gt;
	&lt;li&gt;RedirectDrives (integer, specify 0 for false and 1 for true)&lt;/li&gt;
	&lt;li&gt;RedirectPrinters (integer, specify 0 for false and 1 for true)&lt;/li&gt;
&lt;/ol&gt;</description></item></channel></rss>