With complex and constantly expiring admin passwords, too many RDP sessions, and too many server IPs to keep track of, managing and troubleshooting issues across multiple servers can be troublesome. Today, we will look at a few tips to help make it easier to stay organized and work more efficiently.
Connect Admin Tools Remotely
Nearly every native administration tool or MMC snap-in supports connecting to another computer instead of the local one. When reading through events on multiple servers, it can be much easier to do so by having Event Viewer open on only one computer. It's easier to flip between windows in one session than to move between entirely different RDP sessions. To connect an admin tool to a different server, right click on the topmost node of the tool and choose "Connect to Another Computer…". For example, open Event Viewer multiple times for the local and each remote server you want to review simultaneously. The same tip works for other admin tools like Services, Task Scheduler, and the various Active Directory tools.
Connecting to another computer with a standard MMC snap-in
Work Remotely with CMD
If you're comfortable with CMD and you just need to run a single command on another server, use the "winrs" command to do so quickly. From the server you're already logged onto, open command prompt, then run the winrs command like this: winrs -r:<other server name> "<command to run>". For example, winrs -r:ABCEXFE01 "ipconfig /all"
will run the ipconfig /all command against the ABCEXFE01 server and return the results in the current command prompt.
Running simple CMD commands against another server
Work Remotely with PowerShell
Here are two ways to work remotely with PowerShell to increase your efficiency. First, from PowerShell on your current server, use the Enter-PSSession <other server name>
command to connect your current PowerShell window to another server. For example, running Enter-PSSession ABCEXFE01
will make your current PowerShell window run all future commands against the ABCEXFE01 server. It works similarly to SSHing into a Linux host. The second method is running scripts that collect information from multiple servers at once. For example, maybe you need to compare the hosts file across all Skype for Business servers in a deployment. You can do that by writing a short script that runs from one host, connects to the all of the others to get the file, and then displays them all in the local PowerShell window.
Running a simple script to get DNS Server configuration from multiple servers at once
Hopefully, these tips will help you decrease the amount of time you spend looking for generated passwords and switching between half a dozen RDP sessions. Working with servers remotely is a simple time-saver, and PowerShell scripts can be a lifesaver when you have the same task to do on more than one server.
Please note that these examples require additional network ports open between the source and remote server and may require configuration of WinRM (depending on the server version).