PSEXEC + Shared drive access

Experiences, small talk, and other automation gossip.
User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

PSEXEC + Shared drive access

Post by sdaly » Wed Aug 10, 2011 2:16 pm

Hi

I have build an automation remote which uses psexec underneath.

The command I am using is -

psexec.exe \\computerName -i "C:\Program Files\NUnit 2.5.10\bin\net-2.0\nunit-console.exe" /fixture:GFI.Automation.TestCases.AgentTests "C:\Documents and Settings\Administrator\Desktop\Automation build.79\GFI.Automation.exe" /process=multiple /domain=multiple

If I run this from a batch file locally (without psexec) everything works fine...If I run through psexec the tests can see the c:\ drive but not any mapped network drives. I am using the absolute path of the mapped drive for example E:\Agents

Has anyone encountered this problem before and if so, is there anything I can do to make this work?!

Thanks
Scott

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: PSEXEC + Shared drive access

Post by sdaly » Wed Aug 10, 2011 2:17 pm

Oh, I've tried the -s switch too with no luck :(

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: PSEXEC + Shared drive access

Post by Aracknid » Wed Aug 10, 2011 3:24 pm

PSEXEC doens't likes mapped drives. You need to use the UNC paths.

Aracknid.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: PSEXEC + Shared drive access

Post by Ciege » Wed Aug 10, 2011 3:55 pm

You can try adding 0 to the -i switch "-i 0" to force PSEXEC to use the main console session.
Also, you are not passing any credentials with the -u -p switches. I think without the proper credentials, then when PSEXEC launches on the remote machine it may not have proper access to see all the mapped drives. I always pass the -accepteula switch as a just in case. If the remote machine may have never run PSEXEC before then the EULA will pop up requiring a manual click to close the EULA screen possibly causing issues with automation.

In summary, I always use the following switches:
-accepteula
-i 0
-s
-u
-p
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: PSEXEC + Shared drive access

Post by sdaly » Wed Aug 10, 2011 4:03 pm

Tried UNC path too but no luck, I think its prob because of the authentication....

I got it working though by calling Net Use with /user:domain\username password to map the drive first then it can be seen... I just realised that PSEXEC creates a new user session and that's why it couldn't see the mapped drives in the logged on users session :)

Cheers
Scott

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: PSEXEC + Shared drive access

Post by sdaly » Wed Aug 10, 2011 4:49 pm

Just read your post there ceige...Ah I never realised you could specify the session, I will give this a shot tommorrow. Although I'm sure in OS's post vista, services run in session 0 and then logged in user sessions start from 1 so I would need to change the session depending on the OS...I might be easier just running the few Net Use commands first :P

I missed out the username and password as it's a VM which has no password set up...I just changed the allowblank key in the registry to 0 ;)