Jump to content

Automatic Login to VMware via RDP


Express

Recommended Posts

Hi All,

Here goes another big question, which I hope you guys can help out with. I have been messing around now for a couple of days now on getting a vmware session via RDP to start with a single login on XP and W2k.

So this is what I am looking to do;

User logs in to his/hers XP/W2k then authenticates with server as usual but then starts a TS (RDP) session for VMWARE which is running on a server. User uses only vmware session and when users logs off the local machines logs off as well. All applications will be installed on users vm.

I have .vbs script which looks like this;

' vmconnect.vbs - Connect to a user's Virtual Machine instead of explorer.exe as the shell.

Dim objShell, objExec, strAppExe

strAppExe="mstsc.exe vmw-%username%.RDP"

'strAppExe="mstsc.exe vmw-%username%.RDP"

Set objShell = CreateObject("WScript.Shell")

Set objExec = objShell.Exec(strAppExe)

Do While objExec.Status = 0

'WScript.Sleep 500

Loop

'Set objExec = objShell.Exec("logoff")

Can you let me know if anyone has tried this or simalar?

I tried VMWARE forum but they were no help they said it is a Windows thing since I need to use RDP. So the best place I know to ask is here.

Thanks all in advance,

Link to comment
Share on other sites


If you're replacing the shell with the rdp client vbscript, this should work as long as the user has the rights to run the script. Otherwise, you'll need to launch the vbscript via a .cmd file if running the .vbs directly doesn't work.

Link to comment
Share on other sites

The script is running via ScriptLogic this is the msg I have been getting,

RDC.bmp

the file vmw-anyname.rdp is within the same folder of the vbscript.

I am running 6.0 RDP on XPs and 5.2 on W2k's

I have reveiwed these as well;

http://support.microsoft.com/kb/281262

and

http://support.microsoft.com/kb/324807

Edited by Express
Link to comment
Share on other sites

I'll try that thanks,

Does anyone else have any other ideas?

This is my setup;

on our logonserver -

I have a \vmware folder which within are the rdp files mstsc.exe, .dll's, the vbscript, and the vmw-anyname.rdp files. The vbscript as you see above calls for the rdp which calls for the vmw-anyname.rdp file.

I know I must be missing something i just can't pin pointed.

Thanks again guys,

Link to comment
Share on other sites

Thanks guys i will give these a try tomorrow back at the office. Thanks for all your help I will let you know what happens so others can have it just a bit easier too.

If you have anything to add please do so.

good night for now...

Link to comment
Share on other sites

Where is the vmconnect.vbs script running? on the local machine? If so it is trying to run mstsc.exe from the local machine and looking for the RDP file on the local machine. Try giving the UNC path to the RDP file and see what that does.

Link to comment
Share on other sites

All,

Ok I finally got it to work;

' vmconnect.vbs - Connect to a user's Virtual Machine instead of explorer.exe as the shell.

Dim objShell, objExec, strAppExe

strAppExe="mstsc.exe /span %logonserver%\netlogon\vmware\vmw-%username%.rdp"
'strAppExe="mstsc.exe /span vmw-%username%.rdp"

Set objShell = CreateObject("WScript.Shell")

Set objExec = objShell.Exec(strAppExe)

Do While objExec.Status = 0

WScript.Sleep 500

Loop

'Set objExec = objShell.Exec("logoff")

I had to add %logonserver%\netlogon\vmware\ above.

So basically the vbscript and and rdp files are on the logonserver. I had to specify where to look and thats why I kept getting the msg prompt. Also you need to add a Group Policy ob the local machine (to test first) then once done you can place on the domaon controller. See http://msdn2.microsoft.com/en-us/library/aa479087.aspx for more infor.

If anyone needs more info let me know and I'll try to explain better.

Thanks all for your help once again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...