Comments on: Installing Patches/Application remotely on windows Machine using Psexec/2010/08/06/installing-patchesapplication-remotely-on-windows-machine-using-psexec/Microsoft Exchange & OWA Resources, Information - Optimize, Support, Manage | How-To | Guides | Reference | AdminSat, 13 May 2017 18:59:37 +0000hourly1http://wordpress.com/By: KO Cobain/2010/08/06/installing-patchesapplication-remotely-on-windows-machine-using-psexec/#comment-12478Sat, 13 May 2017 18:59:37 +0000/?p=1290#comment-12478Hi Everyone!
It does not work for me. I have error on Line 8, Char 1.

This is what I have:

Set objShell = CreateObject(“Wscript.Shell”)
Set objFSO = CreateObject(“Scripting.FileSystemObject”)

set filetxt = objFSO.OpenTextFile(“D:\Equipos.txt”,1)
strPSExec = “D:\PSExec.exe”
rbcopy = “c:\Windows\System32\Robocopy.exe”

strPSExec = objFSO.GetFile(strPSExec).ShortPath
rbcopy = objFSO.GetFile(rbcopy).ShortPath

do Until filetxt.AtEndOfStream
strComputer = filetxt.Readline
strComputer = trim(strComputer)

strCmd = “cmd /C ” & rbcopy & ” D:\Hotfixes\kb4012212_x86.msu” & ” \\” & strComputer & “\D$\Hotfixes\kb4012212_x86.msu”
wscript.echo strcmd
objShell.Run strCmd, 1, True

strCmd = “cmd /C ” & strPSExec & ” \\” & strComputer & ” “”D:\Hotfixes\”” /quiet”
wscript.echo strcmd
objShell.Run strCmd, 1, True

Loop

]]>
By: Prasad/2010/08/06/installing-patchesapplication-remotely-on-windows-machine-using-psexec/#comment-9202Thu, 18 Jun 2015 21:56:39 +0000/?p=1290#comment-9202In reply to madhu.

Hi Madhu,

Refer below link & u can generate report for multiple computers / server on one KB# / Hotfix #

https://gallery.technet.microsoft.com/scriptcenter/Generate-a-Report-for-f71a6800

copy & save below code in notepad & rename to anyname.ps1 grant full permission to yourself & try your luck

computers.txt – mention the name of the servers

$computers = cat c:\computers.txt
$Patch = “KB2819745”
foreach ($computer in $computers)
{
if (get-hotfix -id $Patch -ComputerName $computer -ErrorAction 2)
{
Add-content “Hotfix is Present in $computer” -path “$env:USERPROFILE\Desktop\Hotfix-Present.log”
}
Else
{
Add-content “Hotfix is not Present in $computer” -path “$env:USERPROFILE\Desktop\Missing-Hotfix.log”
}
}

]]>
By: madhu/2010/08/06/installing-patchesapplication-remotely-on-windows-machine-using-psexec/#comment-1816Thu, 31 Oct 2013 13:44:24 +0000/?p=1290#comment-1816I want to get a report in which machines the patch is installed. Is there any way how to get that and include in the script

]]>
By: rav36/2010/08/06/installing-patchesapplication-remotely-on-windows-machine-using-psexec/#comment-859Tue, 24 Jul 2012 03:22:55 +0000/?p=1290#comment-859Hi Krishna,

i would want to install the patch but not to reboot the server, any additional lines should be added to the script?

Thank You

]]>
By: Jon Snow/2010/08/06/installing-patchesapplication-remotely-on-windows-machine-using-psexec/#comment-810Tue, 26 Jun 2012 00:18:22 +0000/?p=1290#comment-810There’s an app called Batchpatch that lets you automate this process. The free evaluation is good for up to 7 remote hosts at a time. Check it here: http://batchpatch.com

]]>
By: Carlos/2010/08/06/installing-patchesapplication-remotely-on-windows-machine-using-psexec/#comment-767Tue, 12 Jun 2012 16:20:50 +0000/?p=1290#comment-767how would I install a list of patches from a folder that contains more than 20 patches to machines that few will need 5 patches other 8 and the rest 20 patches…. any input on this one… this is my dilemma that I have…. please help

]]>
By: NK/2010/08/06/installing-patchesapplication-remotely-on-windows-machine-using-psexec/#comment-712Mon, 19 Mar 2012 18:37:33 +0000/?p=1290#comment-712You must edit the line in the script: “”C:\Hotfixes\””
Change into your patch file name eg. “”C:\Hotfixes\KB999999.exe””

Also, there’s a typo in the script. /quite must be fixed to /quiet

]]>
By: dragon/2010/08/06/installing-patchesapplication-remotely-on-windows-machine-using-psexec/#comment-516Wed, 02 Nov 2011 17:45:17 +0000/?p=1290#comment-516I have also ran into the issue with the /accepteula since it requires user acceptance on psexec.exe

]]>
By: Saj/2010/08/06/installing-patchesapplication-remotely-on-windows-machine-using-psexec/#comment-456Tue, 16 Aug 2011 09:22:35 +0000/?p=1290#comment-456Just stuck after copying. Is it because its a Sqlserver hotfix?

]]>
By: Saj/2010/08/06/installing-patchesapplication-remotely-on-windows-machine-using-psexec/#comment-448Thu, 11 Aug 2011 10:44:01 +0000/?p=1290#comment-448ok finally i manage to run it with manual way i.e inserting the file name instead of . The script copies the file and run for more than 1 min and i can see some message in new command prompt in a flash and thats it. I cant find the KB installed on the remote computer.
Any way i can print the error message on the screen or file?

]]>