Opening up a Sequence of RDP Connections. For updating multiple Remote Desktop Connections - sequence

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.

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

Related

Can not create local user account that allows login anymore

I am trying to create some local user accounts in Windows 10 on my home PC. I can go through the wizard ok, but when I try to login to the accounts I get a message similar to 'user profile service failed the logon'.
The whole story is this:
I want to add a SSD drive to my system (Dell Tower, I do not remember the model). So following some advice, it was suggested to move my user files to another drive so the SSD drive would only have the OS and programs on it. Plus this would keep my SSD required size smaller.
So I started to move my user files using the "Location" tab for the "My Documents" and similar folders to my other drive. This all appeared to work okay.
I then selected my wife's folders but I could not since I was not logged under her account, fine. I logged out of my account and attempted to log into her account (we both have administrator rights). That is when I received the 'user profile failed' message.
I have third account on the system, another admin account, and it too failed. Windows seems to be accepting the passwords, just failing further into the login process.
I logged back into my account and my desktop is completely different, there are only 3 icons there now instead of the ~20 I had before, so something with the 'move' failed? I'm not sure. I moved the files back to the default location and that did not help. I googled the 'user profile service failed' message and it seems this happens often enough that there are fairly detailed instructions about how to fix it.
The one fix was to examine the registry (this was from support.mircosoft.com) HLM\Software\Microsoft\windows nt\CurrentVersion\ProfileList and 'simply' remove the '.bak' suffix from entries that match the accounts that are broke. Set some other values to 0. In my case the values were not present in the values list.
I did this and it did not help. I did reboots at various times throughout this process, but those did not help either....
So I tried to create a new account(s), but no matter how I created the account I could never log into the account. Right now, I have only one account that I can log into.
I have not tried the "net user" command as I have just found some information about here at work. I did have to use that program to reset my account's password recently. I have used the same password at home for years, so I do not know how it changed. Luckily, my wife's account still worked at that time and it was an administrator account. So maybe that was some indication that the 'user subsystem' was failing in someway.
This PC is seldom connected to the Internet, only for Windows updates or downloading a program, like "Open Office", Paint.Net type of things. We mainly use an older XP machine for computer work and a tablet for surfing the 'net. The computer is 'new' to us and we have not migrated our files to it. In fact the PC is seldom used at all and powered off for months at a time. I am pretty much the only person that even uses the system, my wife went through a "Dummy's for Windows 10" book and decided it was too different to really bother with learning a whole new thing.
I will try 'net user' tonight to add another account and see if that helps.
Thanks for any hints or suggestions.
I'm not 100% sure what's happened, but it looks like the accounts are probably corrupted. You can do it, but Windows much prefers to have the user profiles on the same drive as the installation itself. Moving them entirely may be the cause of the issue.
(For future reference, If you want to copy user accounts across to a new SSD, it's always best to start here: C:\Users\xxxxx). xxx being your userID. If you would like to use it as your primary C:Drive for Windows - I would advise just a clean install.
You could try a couple of things at this point. (Make sure you're connected to the internet if you can)
First, try just making sure your connected to the internet and run all the updates you can. The profile service may just be corrupted and Win10 especially might just need an internet connection to sort it automatically.
Try booting into recovery mode, and run a system restore back a few days. The files may not return but it might fix the profile issues.
If you can still login to your wifes profile, use this tool (after backing up your files) to clear out all the old profiles.
Net user will likely just enable the hidden admin account, and would not be all that useful if your wife's account is already and administrator.

How to get my vb.net program to use one network over another

vb.net programmer and I am curious to know if there is a method to use so any program i am developing can select a specific network. I am asking this because i recently noticed that while on the wifi, i was still able to access a mapped drive from the lan connection. if there are any resources out there to enlighten me, im all ears because its annoying to constantly switch to my lan connection every time i have to test or deal with a db issue. Additional information: my programs connect to microsoft sql servers on the lan network.
Well I think I found an answer to my question, though it does not have anything to do with vb code. Since I am only dealing with two connections: my departments wifi and may workplace's main network(lan) , I decided to change the metric value of the lan connection to 9999 and left the wifi as automatic. somehow Im able to keep both connections open and my program connects normally to the mssql sever on the lan while im able to use my department's wifi for testing and browsing. interesting stuff there. thanks for the interesting links though.

Data source name not found and no default driver specified

This error is occurring on every *.asp page in the application, but the *.aspx pages work just fine.
I did not develop the application, but the person who did has long since left the company. We have about 20 customers, all with the program working just fine. One of the customers had their server crash, and we had to re-set it up on their new server. Everything is working just fine now, except for this error on the *.asp pages.
The same connection string is used for all of our customers, so I know the problem is not there. There are no system DSNs or user DSNs defined on any of our customers.
This is a 32-bit application on a 32-bit server (server 2003 with SQL 2005).
I'm pretty sure it's a permissions or setting error, but I have checked absolutely everything I can think of.
Please help.
A company with 1400 employees can't use this program until I get it back up and running. I have no idea what else to do.
Thanks everyone for your help.
Sorry it took me a little bit to respond to you, but I had heard back from the original developer, and he had a hidden connection string deep within the program specifically to trip someone up if they were trying to install the program without authorization. He gave me the info I needed and it worked beautifully.
Thanks again!

SSMS 2012 hanging when opening multiple query windows or files

I recently upgraded from 2005 to 2012 (about 10 months). When I first started using SSMS2012 it worked great was able to open multiple windows in a particular database. For about that last 2-3 months SSMS hangs when I try to open more than 1 query window or open a file. It is random but happens a majority of the time. I have been able to interrupt the hang a few times. When I interrupt it I get the login screen and it sits there trying to log in apparently unsuccessfully. If I cancel the login and try it again with the same entries it connects just fine and things are great, but I have to do this for every window and I cannot often break into that screen before it stops responding.
I have searched extensively and have not found an answer to this problem. It only appears to be happening to a particular instance. The instance does not show any signs of issues, has been rebooted and configuration checked for inconsistencies, etc. I am at a loss. If anyone has experienced this and has been able to resolve it I would appreciate a response.
Again this is a fresh install of 2012 standard with 2005 imported databases. All indications show that it is working fine. compatibility level for a majority of the databases are still 90, until I can clear them for 11 with the software they house. I have a test environment with the restored versions on a different server and no issues result from that instance - I can open up multiples without incident. My belief is it is something with that particular instance, but I am not sure where else to look.
Thank you in advance.

How do I distribute updates to a Access database front end?

I've got an Access 2007 database that I developed which connects to SQL Server for the actual data storage. I used the Package Solution Wizard to create a distributable installer which included access runtime (with an ACCDE file) which I went around and installed on 15 or so PCs. Anyway, my question is, what is the best way to distribute updates to this database? Right now I'd need to go around and remove and reinstall. That's not a problem... I was just wondering if there was another way.
I've tried leaving the front end on a network share but it seems that most people suggest storing the front-end on the local machine, which makes sense. The problems I've run into when I leave it on a network share (at least with Access 2003 mdbs) is that I find myself needing to compact and repair often and I also have to kill the open sessions (user's who have the file open) when upgrading. I would imagine it could also hypothetically create an unnecessary bottleneck if the user was not on the local network.
Automating front-end distribution is trivial. It's a problem that has been solved repeatedly. Tony Toews's http://autofeupdater.com is one such solution that is extremely easy to implement and completely transparent to the end user.
We developed a vbscript 'launcher' for our access apps. That is what is linked to on the start menu of user's pcs and it does the following.
It checks a version.txt file located on a network share to see whether it contains different text to a locally stored copy
If the text is different it copies the access mdb and the new version.txt to the user's hard drive.
Finally it runs the mdb in access
In order to distribute an update to the user's pc all that is required is to change the text in version.txt on the network share.
Perhaps you can implement something similar to this
Make a batch file on the server (network drive).
Create a shortcut link to that batch file.
Copy the shortcut to User's Desktop.
When user double-clicks on shortcut, it will copy a fresh copy from network to local.
Replace old database.adp on the server drive when you update a new version.
Each user gets a copy of database.adp on their machine.
Remove Security warning when opening file from network share is here.
Batch File
#ECHO OFF
REM copy from network drive to local
xcopy "Your_Network_Drive\database.adp" "C:\User\database.adp" /Y /R /F
REM call your database file - Access 2007
"C:\Program Files\Microsoft Office\Office12\MSAccess.EXE" "C:\User\database.adp"
This is a very old post and I used the autofeupdater until it stopped working so I wrote one of my own and it has evolved over the last few years into something that I have used with many clients. It's so simple to use and there is no interface. Just an EXE and a very simple config file.
Please check it out here. I can also help with custom solutions if none of the configurations work for your needs. http://www.dafran.ca/MS-Access-Front-End-Loader.aspx
After trying all of the solutions above (not exactly these solutions but these are the common suggestions in the Access community), I developed a system entirely within Access using VBA that allows an admin DB to create and publish objects to client DBs without the need for user intervention or management of multiple DB files.
This approach has several benefits:
1. It simplifies the development process by having a dedicated environment (admin DB) for development and testing totally separate from the client DBs.
2. It simplifies the update/distribution process by allowing a developer to push out updates in real time that client DBs can implement in the background, without involving users. Can also allow devs to roll back to previous versions if desired.
3. It could be used as a kind of change management system within Access for developers who want to commit multiple changes to objects and modules and retain past changes.
4. It allows for easier user access control by allowing an admin to easily assign certain objects to specific users/roles without needing to maintain multiple versions of the DB.
I will hopefully post the code to GitHub soon, I just have to get clearance from my workplace to release it. I will edit this post to include the link when I have.
We have usually kept the Access front ends on network drives, and just put up with the need to compact and repair on a regular basis. You will probably find you need to do that even when they are installed locally, anyway.
If you must have it installed locally, there are various tools which will enable you to "push out" software updates, and the guys over on ServerFault would have more information on those. Assuming such tools aren't available, the only other option I can think of is to write a small loader program that checks the local .MDB against a master copy on the server, and re-copies it across if they are different, before then launching the MDB.