Cannot run remote commands from mapped drives. 
Author Message
 Cannot run remote commands from mapped drives.

I am trying to run(invoke) commands on remote box. These commands
reside on a mapped drive(i.e. external drive) on the remote box.
When I run the following script, it just wouldn't invoke the command.
If I copy the command to a local drive, it works.

---
Dim lProcessID
Dim v
Dim result

RemoteMachine = "ntdevlog441"

Set v = GetObject("winmgmts:{impersonationLevel=impersonate}!//"&RemoteMachine&"/root/cimv2:Win32_Process")

result = v.Create("m:\test.exe",null,null, lProcessID)
---

Thanks,
Sandiyan.



Tue, 04 Jan 2005 19:15:46 GMT  
 Cannot run remote commands from mapped drives.

Quote:

> I am trying to run(invoke) commands on remote box. These commands
> reside on a mapped drive(i.e. external drive) on the remote box.
> When I run the following script, it just wouldn't invoke the command.
> If I copy the command to a local drive, it works.
> (snip)
> Set v = GetObject("winmgmts:{impersonationLevel=impersonate}!//"&RemoteMachine&"/root/cimv2:Win32_Process")

Your process on the remote computer does not have access to any network resources when using NTLM
authentication (default).

When you use NTLM authentication, after the impersonation, the process/thread can only access local resources.
If you use Kerberos authentication instead, you will be able to access network resources.

Platform SDK: WMI
Setting the Authentication Type Using VBScript
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/setting_the_authen...

A workaround (when using NTLM authentication), seems to be to use NullSessionShares:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q122702

and a couple of newsgroup articles:


Subject: Re: Remote software installs of MSI packages via WMI
Newsgroups: microsoft.public.wbem
Date: 2001-02-28 03:29:55 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=OE4WxjXoAHA.2...


Subject: Launching a program remotely
Newsgroups: microsoft.public.wbem
Date: 2001-10-17 10:31:56 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&th=63b102c2512583fd

--
torgeir



Tue, 04 Jan 2005 19:47:46 GMT  
 Cannot run remote commands from mapped drives.
Thanks for the info...
I have gone through trying to set it up according to KB/articles, but
it I am still getting 'access denied' message.
1. machine A - VB scripts reside here
2. machine B - VB scripts access this machine. Has a drive(e.g. E:\)
mapped to a disk in machine C
3. machine C
All of the above 3 boxes are on the same domain and use same domain
account to login - this account has administrator(local) privilegs

I have configured(and re-booted) the registry machine B AND machine C
to have the following;
___
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters\NullSessionShares=PUBLIC
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters\RestrictNullSessAccess=0

I wasn't quite sure whether setting it to PUBLIC on first registry
change is correct or not???
___

and here's the VBscript that I am using...
___

Dim lProcessID
Dim v
Dim result

RemoteMachine = "ntdevlog441"

Set v = GetObject("winmgmts:{impersonationLevel=impersonate,authority=ntlmdomain:fuenv4}!//"&RemoteMachine&"/root/cimv2:Win32_Process")

result = v.Create("e:\test.exe",null,null, lProcessID)

WScript.Echo result
___

Any help is appreciated...
Thanks,
Sandiyan



Sat, 08 Jan 2005 17:52:56 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Remote computer - Run batch file from mapped drive.

2. MAPPING A DRIVE ON A REMOTE MACHINE

3. mapping remote systems as network drives

4. List of all mapped drives on Remote Machine

5. Mapping Remote Drives via VB-Code ?

6. Run.bat files on mapped drives

7. Using the map drive api's and running it as a service

8. Access mapped drives from Shell.Run

9. Cannot run from a networked drive

10. How do I map a drive that has already been mapped

11. rename a drive / map network drive

12. get drive size from network network mapped drives

 

 
Powered by phpBB® Forum Software