0

I Have to update the Servers here at work close to monthly. This includes windows updates and a few other software updates. We have close to 50 or so servers, and I would say 10 are physical and 40 are virtual. I have to open up an RDP connection for each of these servers and update them manually. (At least that is what I have been instructed to do, and haven't heard of a better alternative.) I would give a picture to describe what it looks like that I do when I have to open each of these up. However I need 10 reputation to do so from what its telling me.

So I guess I'll just have to hopefully explain this process clearly without the picture.

So the main issue that I would like to save time on, is I have to manually type out the name of the server, and then the username and password like normal. I would like to create an automated way to do this. I'm willing to have to put in the password each time, but it would save a ton of time not having to manually start another connection each time. Here is the code I've tried to piece together from resources on the internet and on stack overflow to create a batch file that would open all these Remote Desktop Sessions:

cmdkey /generic:"servername" /user:"username" /pass:"password"

start mstsc /v:"servername"

cmdkey /generic:"servername" /user:"username" /pass:"password"

start mstsc /v:"servername"

cmdkey /generic:"servername" /user:"username" /pass:"password"

start mstsc /v:"servername"

.......etc for the other 47 RDP connections

*DISCLAIMER I'm NOT an expert coder. I don't have a lot of expertise with coding, but I do my best to research as much as possible to understand what someone else's code is accomplishing. Obviously if I would have been able to think this through on my own, I wouldn't be posting, but since I'm a bit stuck, I'm interested to see what others can offer to help correct my thinking.

So from what I understand I'm doing here, is that I'm using cmdkey to "store" my username and password for each of these server connections. And with the /generic: classification I believe is where I put the individual different names of each of the servers, so it stores my user name and password based on each server. The "start mstsc /v:"servername" is just simply telling RDP to open up the connection to that server immediately to the prompt where "username and password" are normally required unless you try to add the cmdkey step that I added above.

I have noticed that this has caused a couple "glitches" which are a bit odd. One is that it can't keep open more than 3 or 4 of the connections open, because whenever I go to the next server to login, it "replaces" one of them. This does not happen though if I open each of them up individually(which takes a lot of time to do).

Another issue, is I've gotten this to work on a small scale with only 2 servers as an example. Our domain controller, it accepts the cmdkey line, and puts me right to the desktop of that server, but when it tries to open up the second RDP connection, it comes up with the "Windows Security" window and asks me to "Enter your credentials". which is not a step that I have to do only with that one other server. So if someone could clarify why some servers don't require this step in the RDP connection, and others just go straight to the server and ask for the username and password there, that would be nice to know.

Thanks guys. I hope that this question isn't to "basic" or vague. I am sorry I am a noob, but I'm always excited to learn more about coding and new ways to do things to make life simpler and help others. Let me know if you need any clarification, I'll be glad to offer it.

cretixium
  • 23
  • 1
  • 7

1 Answers1

-1

An extremely helpful and powerful tool that I have found for this problem, is called Remote Desktop Connection Manager 2.7, or RDCMan for short. I've been using this on my Windows 7 64bit desktop, and I've been working with servers ranging from Windows server 2000 to Windows server 2008 and I believe I've read somewhere it also works with Windows server 2012.

It's offered through the microsoft website linked here: (without the quotes) " https://www.microsoft.com/en-us/download/details.aspx?id=44989 ".

To give props for this great tool, here is the About info: Remote Desktop Connection Manager by Julian Burger

RDCMan v2.7 build 1406.0

Microsoft Windows NT 6.1.7601 Service Pack 1 .NET v4.0.30319.34209 mstscax.dll v6.3.9600

cretixium
  • 23
  • 1
  • 7