Hello.
My goal is to restore a remote desktop to the local console so that the user doesn't have to re-enter their password and log back in. While connected remotely to a Windows 7 machine via RDP, I run the following command in a batch file:
tscon %sessionname% /dest:console
This works fine if I connect via RDP with an account in the Administrators group. The problem is when I RDP to the remote machine with an account that's not in the Administrators group, I get the following error:
Could not connect sessionID 1 to sessionname console, Error code 5
Error [5]:Access is denied.
The batch file needs to be run as an Administrator for it to work. I don't have the Administrator account password, but I do have credentials for an account that is in the Administrators group on the machine. I've tried a few different things to run the batch file as an Administrator, but I can't get it to work right.
So my question is how can I get the tscon.exe command to work on this remote machine as a non-Admin?
Any suggestions would be greatly appreciated. Thanks.
My goal is to restore a remote desktop to the local console so that the user doesn't have to re-enter their password and log back in. While connected remotely to a Windows 7 machine via RDP, I run the following command in a batch file:
tscon %sessionname% /dest:console
This works fine if I connect via RDP with an account in the Administrators group. The problem is when I RDP to the remote machine with an account that's not in the Administrators group, I get the following error:
Could not connect sessionID 1 to sessionname console, Error code 5
Error [5]:Access is denied.
The batch file needs to be run as an Administrator for it to work. I don't have the Administrator account password, but I do have credentials for an account that is in the Administrators group on the machine. I've tried a few different things to run the batch file as an Administrator, but I can't get it to work right.
So my question is how can I get the tscon.exe command to work on this remote machine as a non-Admin?
Any suggestions would be greatly appreciated. Thanks.