| Home | Sitemap | Feedback | About... |
Custom Search
|
Other FAQ sections: Installation | Server configuration | Client resources | User issues | Licensing | Printing | Connectivity | Profiles | Performance | Applications | Administration & Monitoring | More FAQS
Q: Terminal Services Manager tool starts minimized and can't be maximized
Last modified: June 17, 2007
A: The problem is that at some point the TS Manager window position settings were saved in a high-resolution session; with it running in a low-resolution session, those values position it off the viewable screen.
To solve the problem, start regedit and navigate to this registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSADMINDelete the "Placement" value and exit regedit.
Now start Terminal Services Manager and you should be able to find it.
For a related issue, check:
277689 - You May Not Be Able to Switch Back and Use the Terminal Services Manager
Top of page | FAQ | Home
Q: How can I use the Remote Desktops snap-in from 2003 Adminpak.msi without installing all the tools?
Last modified: June 20, 2008
A: You can install the individual tools from the 2003 Adminpak on your XP client. This is explained here:
314978 - How to use Adminpak.msi to install a specific server administration tool in Windows
Unfortunately the only tool not mentioned in KB 314978 is the Remote Desktops snap-in.
But you can install it manually by unpacking the msi package with the command
msiexec /a adminpak.msiThe files you need are in the \system32 folder. Copy tsmcc.msc and mstsmcc.dll to your local \system32 folder, and register the dll with the command
regsvr32 mstsmmc.dllThen you can run mmc and add the Remote Desktops snap-in.
Unfortunately, the Remote Desktops snap-in does not support the use of the /admin switch. So if you install XP SP3 and thus rdp client 6.1, you cannot use the Remote Desktops snap-in to connect to the console session of a Windows 2003 server. See How can I start a console session from a XP SP3 or Vista SP1 client? for details.
Top of page | FAQ | Home
Q: How can I change which users or Administrators can connect to the console session?
Last modified: March 9, 2008
A: By default, only Administrators can connect to the console session remotely, with "mstsc /console" (rdp client 6.0 or earlier) or "mstsc /admin" (rdp client 6.1). TS has a WMI provider which allows you to change the default setting. An easy way to access the WMI provider is with the WMI Command-line (WMIC) utility.
To allow a normal user to connect to the console session, use the following command:
WMIC RDPermissions where "TerminalName='console'" call AddAccount "domain\UserName", 2To deny administrators access to the console session, use the following command:
WMIC RDAccount where "TerminalName='console' and AccountName like '%administrators%'" call deleteTo restore the default setting:
WMIC RDPermissions where "TerminalName='console'" call RestoreDefaults
Here's more info:
Win32_TSPermissionsSetting class
Win32_TSAccount WMI class
Remote Configuration with WMI
WMI Command-line (WMIC) utility
Top of page | FAQ | Home
Q: How can I start a console session from a XP SP3 or Vista SP1 client?
Last modified: June 20, 2008
A: With rdp client versions up to 6.0, you could connect to the console session of a Windows 2003 server by
using the "mstsc /console" command.
XP SP3 and Vista SP1 include version 6.1 of the rdp client. The /console switch is not supported anymore, and silently
ignored when used. Instead, you have to use the /admin switch.
The reason for this change is an architectural change in Windows Server 2008. Session 0 is not an interactive session
anymore, it's only used for services. So on Windows Server 2008, the console session is in no way different from any
other session, and the /console switch became meaningless. The /admin switch is used to access the only session which
is free of TS CALs requirements when connecting to a 2008 server with the Terminal Services role.
947723 - Changes to remote administration in Windows Server 2008
Top of page | FAQ | Home
Q: How can I start a console session from a Macintosh RDC client?
Last modified: March 9, 2008
A: Using Mac RDC client version 1.0.3, you can start a console connection (the equivalent of "mstsc /console" or "mstsc /admin" on a Windows client) by holding down the [Command] key while clicking the "Connect" button. Or write "/console" (without the quotes) in the connection box, after the hostname.
Or open the connection file in your favorite text editor and add this line to the file:connect to console:i:1Using Mac RDC client version 2.0 (beta 2), the only possible method is to add /console after the hostname in the connection box , like:
my_server /console
Top of page | FAQ | Home
Q: Can I start a console session from my PDA?
Last modified: August 7, 2007
A: Unfortunately, '/console' mode is not supported on the Windows Mobile remote desktop client.
Top of page | FAQ | Home
Q: How can my script / application detect if a Windows 2003 server is in Remote Administration or Application Server mode?
Last modified: June 17, 2007
A: You can check which mode the Terminal Server is in by checking the contents of the following registry key:
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\TSAppCompat0 = Remote Administration, 1 = Application Server mode
Note that this key only will let you see what mode the server is in. You can not switch between the modes just by toggling the key.
Interactively, the easiest way to check is in Terminal Services Configuration - Server Settings - Licensing.
Top of page | FAQ | Home
Q: How can my script / application detect if Remote Desktop for Administration is enabled on a Windows 2003 server?
Last modified: June 21, 2008
A: You can check if Remote Desktop for Administration is enabled by examining the contents of the following registry key:
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\fDenyTSConnections0 = Remote Administration is enabled, 1 = Remote Administration is disabled
Note that this key is read-only. You can not enable RDfA just by toggling the key.
Interactively, the easiest way to check is in Control Panel - System - Remote.
Top of page | FAQ | Home
Q: How can my script / application detect if a Windows 2008 server is configured for Remote Administration or running the Terminal Server role service?
Last modified: June 20, 2008
A: You can check the mode of the Windows Server 2008 server using the
TS WMI Provider's
Win32_TerminalServiceSetting
LicensingType property:
1 = Remote Desktop for Administration
2 = Per Device. Valid for application servers
4 = Per User. Valid for application servers
For more info and examples, read Terminal Services (TS) Remote Configuration Primer Part 1
Top of page | FAQ | Home
Q: How can my script / application detect if Remote Desktop for Administration is enabled on a Windows 2008 server?
Last modified: June 20, 2008
A: You can check if Remote Desktop for Administration is enabled on a Windows Server 2008 server using the
TS WMI Provider's
Win32_TerminalServiceSetting
AllowTSConnections property:
0 = Remote Desktop for Administration connections are allowed
1 = Remote Desktop for Administration connections are not allowed
For more info and examples, read Terminal Services (TS) Remote Configuration Primer Part 1
Top of page | FAQ | Home
Q: How can my script / application detect if it is running in a Terminal Services client session?
Last modified: June 17, 2007
A: You can detect if your application is running in a remote session by calling GetSystemMetrics().
The following function returns TRUE if the application is running in a remote session and FALSE if the application is running on the console.
BOOL IsRemoteSession(void){
return GetSystemMetrics( SM_REMOTESESSION );
}
Recommended reading:
Terminal Services Programming Guidelines
Top of page | FAQ | Home
Q: How can my script / application retrieve the session id of the session it is running in?
Last modified: July 29, 2007
A: To retrieve the session identifier of the session that your application is running in, you can use the GetCurrentProcessId function to retrieve the process identifier. Then use the process id to call the ProcessIdToSessionId function to retrieve the session id.
Top of page | FAQ | Home
Q: How can I retrieve the client IP number?
Last modified: April 27, 2008
A: You can retrieve the client IP number and computername with the WTSQuerySessionInformation function, or the client computername with the environment variable %CLIENTNAME%.
BUT: read this:
951422 - The WTSQuerySessionInformation function on a Windows Server 2008-based terminal server returns ambiguous IPv6 address data
Or download GETTSCIP, a freeware command-line tool to obtain the current session's client IP address, from Ctrl-Alt-Del IT Consultancy.
Top of page | FAQ | Home
Q: How can I track which users are logging on to my Terminal Server?
Last modified: July 17, 2008
A: If you enable auditing of security events, you will see all logon and logoff events in the Security tab of the EventLog on the TS. You can filter and export these events once a month to a tab-delimited textfile for further processing.
Or you could make your own, very simple daily logon report by adding a line to your TS-specific login script:
echo %username% %clientname% %date% %time% >> %date%_logon.log
Update: an anonymous visitor emailed me that the %date% environment variable contains characters which are illegal in a file name and that the above command would not create a file. Since I use this command in all of my servers, I was puzzled at first, until I understood that it is dependent on the regional settings and the date format. Swedish date format is yyyy-mm-dd, which is perfectly legal in a file name, but the American format of mm/dd/yyyy is not.
Top of page | FAQ | Home
Q: How can I retrieve the total number of sessions on my Terminal Server?
Last modified: December 5, 2007
A: TS Manager shows you all existing sessions, but doesn't give the total count.
There are many ways to retrieve this type of information, all giving slightly different results. If you only need this
information on an ad hoc basis, the easiest is probably to type one of the following commands in a command window:
query session /counteror
query user | find "rdp-tcp#" | find /c " Active "
If you are running Windows 2003 on your TS, you can also use the following script (save it as TSSessionCount.vbs):
Set obji = GetObject("winmgmts:{impersonationLevel=impersonate}!Win32_Service='TermService'")
wscript.echo "Total sessions: " & obji.TotalSessions
wscript.echo "Disconnected sessions: " & obji.DisconnectedSessions
Run the script from a command prompt with:
cscript TSSessionCount.vbs
But if you want to collect this information over a longer time period, use Performance Monitor, add the "Active Sessions", "Inactive Sessions" and "Total Sessions" counters from the "Terminal Services" object to a new Counter Set, create a Performance Counter Log and, optionally, a Performance Alert.
Top of page | FAQ | Home
Q: How can I remotely kill disconnected sessions?
Last modified: June 17, 2007
|
A: The easiest way to kill disconnected sessions from your workstation is to use a command line tool. To list all sessions on a server: qwinsta /SERVER:servernameTo end a session:
rwinsta {sessionname | sessionid} /SERVER:servername
For a list of all remote administration command-line tools and their syntax, check KB article
243202
|
Top of page | FAQ | Home
Q: How can I kill all active sessions at a specific time?
Last modified: June 17, 2007
A: Schedule a job on the Terminal Server which resets all sessions. Don't forget to disable new logons as well, otherwise active users will be back within seconds.
Job would look like this:
REM ** Disable new logons
change logon /disable
REM ** Throw out all existing sessions by resetting the listener session
for /f "tokens=2" %%i in ('qwinsta ^| find /i "listen"') do echo y | rwinsta %%i
REM ** Maintenance jobs like backup comes here
REM ** start /wait ensures that this job waits until the command
REM ** is executed completely before going on to the next command
start /wait <your maintenance command comes here>
REM ** Maintenance is finished. Let users in again
change logon /enable
Note that if you want to test the reset command line interactively on the console of the server, you have to use %i instead of %%i (which is needed in a scheduled batch job).
Important: if you include a reboot of the server in the above script, be sure to launch another script on startup of the server which enables logons again. A reboot will not automatically do this.Top of page | FAQ | Home
Q: How can I Remote Control my Windows XP SP2 client from within Terminal Services Manager?
Last modified: August 23, 2008
A: ServicePack 2 disabled this feature. You can enable it again by creating the following registry entry on the XP client:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server "AllowRemoteRPC" = REG_DWORD:1Also make sure that the Windows firewall on the client is configured to allow File and Print sharing, as well as Remote Desktop.
If you want to be able to browse to the XP client instead of using the "Actions" - "Connect to Computer..." menu in TS Manager, then you'll also have to change the value of this registry entry on the XP client:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server "TSAdvertise" = REG_DWORD:1
Top of page | FAQ | Home
Q: How can I Remote Control my Windows 2000 Pro / Vista Home client?
Last modified: August 5, 2007
A: You can't do this with the Remote Desktop Protocol client. Windows 2000 Pro, Vista Home Basic and Vista Home Premium workstations can only be rdp clients, not hosts.
Use NetMeeting or VNC instead to connect to these desktops.
The only desktop OSes which support rdp sessions are XP and Vista Business, Enterprise or Ultimate.
Top of page | FAQ | Home
Q: How can I Remote Control my Macintosh client?
Last modified: June 17, 2007
A: To connect from a Windows OS client to a Macintosh client, use VNC. The Apple Remote Desktop client has a built-in VNC client. Check in the Sharing Preferences pane in System Preferences.
Top of page | FAQ | Home
| Copyright © 2002-2008 Vera Noest |