none
remote copy issue on Windows 2008 using WMI RRS feed

  • Question

  • Hi, experts

    I try to use WIM JS script to connect to a remote Windows2008 SP2 DC. The script locates on "test1". I want the win2k8 copy some files from "test1" 's shared folder. Here is what I have done:
    var
     Locator = new
    ActiveXObject("WbemScripting.SWbemLocator"
    );
    Locator.Security_.AuthenticationLevel=6;
    Locator.Security_.ImpersonationLevel = 3; //Impersonate; var Service = Locator.ConnectServer(client, "\\root\\cimv2" , userAccount, userPass); var strCommand = "xcopy /I/Y \\10.xxx.xxx.233\ip\ c:\ip" ; var intProcessID = "" ; var objStartup = service.Get("Win32_ProcessStartup" ); var objConfig = objStartup.SpawnInstance_(); objConfig.ShowWindow = 1; //show objProcess = service.Get("Win32_Process" ); var intReturn = objProcess.Create(strCommand1, "c:\\" , objConfig, intProcessID); WScript.Echo (intReturn);
    I can ensue the files are exists and shared well. The "create process " returns 0 always, which means the process is created successfully.  But when I checked win2k8, there are no such files. However, I can connect my laptop, which is xp  to do this.

    In addition, I can start a programmer like "notepad.exe" successfully.  And also check the user privilege of COM server and WMI as MSDN says...

    Can anyone help me on this,  thank you very much!!

    Btw, any operation to the disk though wmi , like create shared folder ,will always fail.  
     
    • Edited by streaksean Friday, June 26, 2009 9:07 AM
    Friday, June 26, 2009 9:00 AM

Answers

  • Hi,

    Is UAC enabled on Windows Server 2008? If so, try to disable it and test.

    Also, try to use PsExec to run copy command:

    PsExec \\computer [-u user [-p psswd]] xcopy

    For more instruction, please refer to the following information.
    PsExec v1.95
    http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

    Thanks.

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, June 29, 2009 7:35 AM
    Moderator

All replies

  • Hi,

    Is UAC enabled on Windows Server 2008? If so, try to disable it and test.

    Also, try to use PsExec to run copy command:

    PsExec \\computer [-u user [-p psswd]] xcopy

    For more instruction, please refer to the following information.
    PsExec v1.95
    http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

    Thanks.

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, June 29, 2009 7:35 AM
    Moderator
  • Thanks, Mervyn. That gives lots of help!
    Thursday, July 2, 2009 6:08 AM