Pages

Showing posts with label RDS. Show all posts
Showing posts with label RDS. Show all posts

Monday, April 15, 2019

Remotely terminating a remote session on a Citrix XenApp or RDS server

I’ve been asked several times in the past about the following error that is presented if a user attempts to RDP (remote desktop) to a Citrix XenApp application server:

The target session is incompatible with the current session.

The reason why this message would be presented is because account used for the RDP connection already has an previous ICA session in a disconnected state.  You can verify this by using the net use command to connect to the server, then the query session command to list the sessions on the server:

Step #1 – Connect to the remote server

Launch the command prompt and execute the following:

net use \\<serverName> /user:<adminUserName> <Password>

The command should display the following message if the connection is successful:

The command completed successfully.

Step #2 – Query session on the remote server

Execute the following command to list the sessions on the remote server:

query session /server:<serverName>

The command should display sessions along with the following headings:

  • SESSIONNAME
  • USERNAME
  • ID
  • STATE
  • TYPE
  • DEVICE

Locate the username you are looking as well as the ID number.

Step #3 – Terminate session on the remote server

With the ID of the username you want terminate located, execute the following command to terminate it:

reset session <ID> /server:<serverName>

Step #4 – Confirm that the session on the remote server has been terminated

The command will not provide any output after completion so execute the query session command to confirm that the session has been terminated:

query session /server:<serverName>

Below is an example of the output from the commands executed above:

You should be able to RDP to the server now that the session is no longer present for the account connecting.

Tuesday, January 15, 2019

Attempting to open Excel files within Outlook 2016 in protected mode fails with: “Microsoft Excel cannot open or save any more documents because there is not enough available memory or disk space.”

Problem

You’ve noticed that attempting to open Excel files from within Outlook 2016:

image

… fails with the following message:

Microsoft Excel cannot open or save any more documents because there is not enough available memory or disk space.

To make more memory available, close workbooks or programs you no longer need.

To free disk space, delete files you no longer need from the disk you are saving to.

image

image

Further troubleshooting of the issue shows that this only happens to Excel files received from external senders outside of the Exchange organization and files sent from internal users are fine because files received from external senders are blocked:

image

… while files from internal senders are not:

image

**Note that you can determine where the temporary Excel file is stored when you launch Outlook by navigating to the following registry key item:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\outlook\Security

OutlookSecureTempFolder

imageimage

Reviewing forums and KB articles suggest the following workaround of disabling Enable Protected View for Outlook attachments:

image

image

While this solution works, it reduces the security protection for users because they will now open Excel Outlook attachments in non-protected mode.

Attempting to add the Outlook OutlookSecureTempFolder path as a Microsoft Office Trusted Location would not be a good solution because it also reduces security and Excel would not allow it either:

image

Solution

I wasn’t able to figure this out as all the forum posts I came across suggested the workaround so I opened up a ticket with Microsoft and the engineer eventually found the following KB:

Unable to open to Microsoft Word Documents or Excel Spreadsheets from Outlook 2013
https://support.microsoft.com/en-gb/help/3020607/unable-to-open-to-microsoft-word-documents-or-excel-spreadsheets-from

Reviewing the RDS server that had this problem revealed that the firewall was indeed disabled:

image

Re-enabling it and restarting the server corrected the problem.

Tuesday, July 10, 2018

Minimizing and restoring Windows Server 2016 RDS RemoteApp causes a frozen black screen to be displayed

Update: July 11, 2018

The support engineer gave me a call back yesterday and said this is apparently a known issue at Microsoft and a patch is supposed to be released at some point.  He could not provide an exact ETA but said possibly in August 2018.

Problem

You’ve deployed a new Windows Server 2016 RDS environment and published RemoteApps but received complains that when a user’s session times out after the configured idle limit, they receive the following Windows and unable to click the OK button:

Idle timer expired

Session has been idle over its time limit.

It will be disconnected in 2 minutes.

Click OK to stay connected.

image

The problem with the window above is that the RDS RemoteApp session has disconnected but the window indicating the end of the session is stuck behind this warning window. There is really nothing the user can do to get the window in the background to get on top of this one so they need to terminate the RDS session via the task bar.

One of the solutions that correct this issue is to disable the Use advanced RemoteFX graphics for RemoteApp configuration found:

Computer Configuration > Policies > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Remote Session Environment

imageimage

Disabling this feature corrects the problem but it creates a new problem where if the user’s desktop launching the RemoteApp does not have the left most monitor as their primary monitor:

image

What happens with this setup for users is that they would launch the RemoteApp without any issues:

image

The application will work as expected but if the user minimizes it:

image

Then attempts to restore the RemoteApp, the application will attempt to be restored on the left non-primary monitor and display a black screen that the user cannot interact with:

image

This appears to only be a display issue because the user can right-click on the application in the task bar, close it, relaunch the application and not lose any work. What’s strange is that this does not appear to affect applications that are not maximized meaning if the application was launched and then minimized as such:

image

The application would restore without any issues. Another alternative workaround is to configure the left most monitor as the primary:

image

Another workaround I was able to find was to limit the amount of monitors for the RemoteApps with the Limit number of monitors configuration:

imageimage

While this corrects the issue, it restricts the application to the primary monitor disallowing the user to drag the window to the left or any other monitor and this was likely going to be very annoying.

I had opened a case with Microsoft about two weeks back, which was closed because I couldn’t replicate it on my desktop (I always use my left most monitor as primary) but have been since reopened this week after figuring this out. The engineer hasn’t called me back yet but knowing the cause allowed me to find this forum post discussing the same problem on Windows 10:

[Windows 10 1709] Issues when maximizing RDP App

https://social.technet.microsoft.com/Forums/lync/en-US/831fda26-1336-4806-a3eb-8b989e023a52/windows-10-1709-issues-when-maximizing-rdp-app?forum=win10itprogeneral

I had this issue too. I found that re-enabling remotefx on session servers made the issue go away. But now window focus is messed up, when a new window pop up in a remote application it goes behind the main application until user clicks out of the app, the pop up will appear.

image

The environment I’m experiencing this problem uses Windows 7 as the desktop so I can confirm that this isn’t limited to Windows 10. There isn’t a resolution in the forum post so I hope to get to the bottom of this and share the resolution.

Saturday, March 4, 2017

Hide Favorites, Libraries, Network and redirected local drives for Citrix and RDS published RemoteApp applications

One of the most common questions I’ve been asked by clients with Microsoft RDS deployments is how to hide the Library, Favorites and redirected local drives for RDS published RemoteApp applications.  The reason for this is because many administrators have noticed that users are unable to differentiate the Desktop, Downloads and Recent Places folders listed in the Save As dialog box for RemoteApp applications, which reside on the RDS server, and ones located on their local desktop:

image

This isn’t the users fault so to avoid this confusion, it is best to hide these folders and the following demonstrates how to accomplish this.

Taking Ownership and Granting Permissions to Registry Keys

Note that all of the registry keys mentioned below will require taking ownership and granting permissions to the account making the changes because only the TrustedInstaller has permissions to the keys. I won’t go into the details but I’ll include screenshots of what the process looks like:

image

image

image

image

Hiding the Favorites Menu

Hiding the favorites menu as shown in the screenshot below:

image

… requires modifying registry keys as shown in the following:

For 32-bit applications

Navigate to the following key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder]

image

Modify the DWord Attributes to a9400100:

image

image

For 64-bit applications

Navigate to the following key:

[HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder]

image

Modify the DWord Attributes to a9400100:

image

image

Hiding the Libraries Menu

Hiding the libraries menu as shown in the screenshot below:

image

… requires modifying registry keys as shown in the following:

For 32-bit applications

Navigate to the following key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder]

image

Modify the DWord Attributes to b090010d:

image

image

For 64-bit applications

Navigate to the following key:

[HKEY_CLASSES_ROOT\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder]

image

Modify the DWord Attributes to b090010d:

image

image

Hiding the Network Menu

Hiding the libraries menu as shown in the screenshot below:

image

… requires modifying registry keys as shown in the following:

For 32-bit applications

Navigate to the following key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\ShellFolder]

image

Modify the DWord Attributes to b0940064:

image

image

For 64-bit applications

Navigate to the following key:

[HKEY_CLASSES_ROOT\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\ShellFolder]

image

Modify the DWord Attributes to b0940064:

image

image

Hiding the Favorites Menu

Hiding the redirected local drives as shown in the screenshot below:

image

… requires applying the following group policy configuration to the server object:

Computer Configuration > Policies > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Device and Resource Redirection

image

image

image

Enabling Do not allow drive redirection will prevent the local redirected drives from being accessible:

image