Skip to content

Windows Snippets

Terminal window
# Check disk for errors
chkdsk /f d:
# Attempt to repair logical file system errors during the scan with /f switch.
# If drive in use, you'll be asked to schedule a scan for the next restart
CommandUsage/Function
certmgr.mscCertificates
ciadv.mscIndexing Service
comexp.mscComponent Services
compmgmt.mscComputer Management, central administration panel for Windows. Can also be used to access IIS administration console.
control mouseOpen control panel for mouse
defrag, dfrg.mscDisk Defragmenter
devmgmt.mscDevice Manager
diskmgmt.mscDisk Management
eventvwr.mscEvent Viewer
fsmgmt.mscShared Folders
gpedit.mscGroup Policy
lusrmgr.mscLocal Users and Groups
msconfigStartup files and processes configuration
ntmsmgr.mscRemovable Storage
ntmsoprq.mscRemovable Storage Operator Requests
perfmon.mscPerformance monitor
regeditRegistry editor
rsop.mscResultant Set of Policy
sc queryFind function. E.g. Find a Windows services called “WSearch”sc query or FINDSTR /i /r WSearch
secpol.mscLocal Security Settings
services.mscServices and Process manager
wabWindows address book
wmimgmt.mscWindows Management Infrastructure (WMI)
Section titled “Remote Desktop Management related commands”

ERROR The terminal server has exceeded the maximum number of allowed connections

Section titled “ERROR The terminal server has exceeded the maximum number of allowed connections”

If you encounter this error, you can either reboot the terminal server you are trying to remote desktop to or log into the machine as an administrator.

To log in as the administrator:

mstsc /v:<ip address e.g.192.168.2.32) /console

By using /console at the end of the command you will be logging in as if you were at the server. Alternatively, if you are using Windows Server 2003, run this comment instead (replace /console with /admin)

mstsc /v:<ip address e.g.192.168.2.32) /admin

If you can telnet or ssh to the server you can use the following command. This command will kill all active RDP sessions to free one so you can connect.

tsdiscon /1

tsdiscon /2

tsdiscon /3

tsdiscon /4

When you execute the commands above, log in as an administrator on the machine. That log in allow you to use the console on the server.

  1. Remove any disconnected users via the Terminal Services Manager

    Start > All Programs > Administrative Tools > Terminal Services Manager

    Click on the name of your server and the right side should show a list of users. If the users are disconnected, reset the users to free up the two normal remote desktop connections. Right clicking the disconnected user and selecting “Reset.”

    It is good practices to only use the console to disconnect inactive sessions and not for anything else. Make sure you disconnect inactive user sessions first with the instructions above, otherwise if you get disconnected again you will have to physically access the server.

    Remote Desktop sessions should always be closed using the Windows <<Log Off>> function rather than disconnecting by closing the window as using the X to close will disconnect from the session but leave it active.