/build/static/layout/Breadcrumb_cap_w.png

Need help K1000 scripting

I have a job that opens the command prompt and is suppose to copy files to the client system.  The job opens the command prompt but that is it.  I have tried all the settings on the "Run As" tab and still only get the command prompt to launch and that is it.  The script I am running is: Step 1 Launch c:\windows\system32\cmd.exe Step2 START (line 1)xcopy \\(server)\library\software\registry\grouppolicy\*.* c:\Windows\System32\GroupPolicy\ /D/E/C/R/H/I/K/Y (line 2) exit.

Script type is Online KScript: Status is Production: Enabled is checked

Any input would be greatly appreciated


0 Comments   [ + ] Show comments

Answers (2)

Posted by: jknox 11 years ago
Red Belt
3

First off, do the commands complete if you run them in a command prompt? Keep in mind this is with whatever user you are logged in with. You might check the arguments at the end, /D and /K especially: http://ss64.com/nt/xcopy.html

Whatever user you supply under "Run As" has to have access to that share location.  Also, if you don't use "Run As", the command uses LocalSystem which almost never has rights to shares.

I'd suggest creating a batch file with the commands you are using, then upload that as a dependency and then use the "Launch a program" option to run it.


Comments:
  • When I run: xcopy \\(server)\library\software\registry\grouppolicy\*.* c:\Windows\System32\GroupPolicy\ /E/C/R/H/I/Y (remove /D/K), from a command prompt, it runs. The share is an open share. I can run it from any user. I tried different "Run As" settings. I even altered the bat file to:
    @echo off
    net use w: \\nvcc-lofs02\library\software\registry\grouppolicy
    xcopy w:\*.* c:\Windows\System32\GroupPolicy\ /D /E /C /R /H /I /K /Y
    exit
    If I omit the Launch cmd file, I get no Command Prompt.
    No matter what settings I set if the Launch cmd file is inputed then it will launch but that is it. The job just sits there. No error messages. It does not seem that KACE is moving to the next step passed launching a command prompt.

    A couple of tid bits: We jave three domains. The PC is on our student domain. The server is on our Faculty/Staff domain and KACE resides our Master domain that sits between each domain. Remember I still can run the bat command manually from a Command Prompt from the PC or any PC.

    Since I am new to KACE I have not had experience with uploading file. - adminlo 11 years ago
    • I don't think domains make a difference as long as the user that is set up can access the files when you use run as. I could be wrong and they might have to be federated.

      If you use NET USE, you might have to supply a user account on that domain as well.

      I don't have a way to duplicate multiple domains at the moment so I can't test it. I'd suggest open a support ticket so they can take a look: support@kace.com

      Short of that, you could also do this as a short-term workaround:

      Zip up your .pol files and upload them as a dependency to a script and just have the KBOX unzip them to C:\Windows\System32\GroupPolicy. - jknox 11 years ago
Posted by: dugullett 11 years ago
Red Belt
3

I would do what jnox mentioned. Zip your Group Policy folder then copy them over.

Verify File Exists

Directory  c:\Windows\System32\GroupPolicy\

File: Some_File_That_you_copied

Remediation Run Batch File

xcopy GroupPolicy\*.* c:\Windows\System32\GroupPolicy\ /D /E /C /R /H /I /K /Y

exit

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ