Client Management Suite

 View Only
  • 1.  The task is works locally but not work in remote

    Posted Aug 28, 2015 03:46 PM

     

     

    This task include one batch file that can find patches in client computer by remote. I build this batch file as package into ALtiris 7.5.

     

    Now the issue is run batch file in my hard disk by manual, everything is fine. For example, will showed "PC1234, 3065822 Patch found".  I checked PC1234 by remote, the 3065822 patch is installed.

     

    However If I use job task and push this package to my computer (I want this task can automatic run in weekend), then will showed "PC1234, 3065822 Patch does not exist ".

     

    This is code

     

    @ECHO OFF

    SETLOCAL

    set LOGFILE_DATE=%DATE:~6,4%.%DATE:~3,2%.%DATE:~0,2%

    set LOGFILE_TIME=%TIME:~0,2%.%TIME:~3,2%

    set LOGFILE=log-%LOGFILE_DATE%-%LOGFILE_TIME%.txt

    rem log-2014.05.17.txt

     

    echo %date% : %time% > %LOGFILE%

     

     

     

    set PATCH=3078071

     

     

     

     

    for /f %%i in (workstations.txt) do (Call :CHECK %%i)

    Goto End

     

    :CHECK

    Set COMPUTERNAME=%1

     

    :PING

    ping %COMPUTERNAME% -n 1 > .\temp\Ping.txt

    find /I "out" .\temp\Ping.txt > .\temp\Reply.txt

    if %errorlevel% == 0 Echo %COMPUTERNAME%, is Offline >> %LOGFILE% & Goto END

     

    find /I "check" .\temp\Ping.txt > .\temp\Reply.txt

    if %errorlevel% == 0 Echo %COMPUTERNAME%, Host is Not Found >> %LOGFILE% & Goto END

     

     

    REM # Determine patch

    :Search Pathch

     

    wmic /node:%COMPUTERNAME% qfe | find /I "%PATCH%"

     

    REM # IF ERRORLEVEL = 0 it is there

     

    IF %ERRORLEVEL% == 0 (GOTO REPLACE_FILES2) ELSE (GOTO LOOP)

     

     

    :REPLACE_FILES2

    Echo %COMPUTERNAME%, %PATCH% Patch found >> %LOGFILE%

    GOTO END

     

    :LOOP

    Echo %COMPUTERNAME%, %PATCH% Patch does not exist >> %LOGFILE%

     

    :END

     

     

     

     

    I think this code cause issue "wmic /node:%COMPUTERNAME% qfe | find /I "%PATCH%" "

     

    However spent couple hours, can't fix this issues.

     

    Please help me, thanks.

     

     

     



  • 2.  RE: The task is works locally but not work in remote

    Posted Aug 29, 2015 05:38 AM
    How does the batch file get credentials to access the remote computers using wmic?


  • 3.  RE: The task is works locally but not work in remote

    Posted Aug 31, 2015 03:08 AM

    Did you add a firewall exception for "Windows Remote Management" on the client?



  • 4.  RE: The task is works locally but not work in remote

    Posted Sep 01, 2015 02:19 PM

    No, However The task can run success in my workstation by manual.



  • 5.  RE: The task is works locally but not work in remote
    Best Answer

    Broadcom Employee
    Posted Sep 01, 2015 03:19 PM

    Try to use credentials of "Currently logged-in user" or custom credentials, instead of default "Symantec Management Agent credentials" within "Advanced Settings" of this client task in client job.

    Also you have a typo in your script

    • :Search Pathch


  • 6.  RE: The task is works locally but not work in remote

    Posted Sep 04, 2015 08:49 AM

    I try to use credentials of "Currently logged-in user", it's works!

     

    Thank you so much!