Forum Discussion
dmarquesgn
May 29, 2022Iron Contributor
Run Windows Updates with Powershell Remotely
Hi, I'm kind of new to Powershell, and trying to automate some stuff. I found one nice Powershell module named PSWindowsUpdate to manage Windows Updates. I need to create some automated updating fo...
- May 31, 2022Thanks for the tip.
I would like to avoid WSUS, as it also has some challenges, and at the same time I would learn more on Powershell.
Meanwhile I was already able to use a command to update remotely, now I need to deal with errors and logging, which is not so good at the moment.
Set-Item WSMan:\localhost\Client\TrustedHosts –Value * -Force
$Script = {Get-WindowsUpdate -KBArticleID KB4535680 -AcceptAll -Install -Verbose | Out-File C:\Temp\PSWindowsUpdate.log}
Invoke-WUjob -ComputerName <computername> -Script $Script -Confirm:$false -RunNow
Alan2022
Iron Contributor
Hi dmarquesgn
I think the best approach in here is using WSUS in your Company.
So no need for PowerShell to do that.
I think the best approach in here is using WSUS in your Company.
So no need for PowerShell to do that.
dmarquesgn
May 31, 2022Iron Contributor
Thanks for the tip.
I would like to avoid WSUS, as it also has some challenges, and at the same time I would learn more on Powershell.
Meanwhile I was already able to use a command to update remotely, now I need to deal with errors and logging, which is not so good at the moment.
Set-Item WSMan:\localhost\Client\TrustedHosts –Value * -Force
$Script = {Get-WindowsUpdate -KBArticleID KB4535680 -AcceptAll -Install -Verbose | Out-File C:\Temp\PSWindowsUpdate.log}
Invoke-WUjob -ComputerName <computername> -Script $Script -Confirm:$false -RunNow
I would like to avoid WSUS, as it also has some challenges, and at the same time I would learn more on Powershell.
Meanwhile I was already able to use a command to update remotely, now I need to deal with errors and logging, which is not so good at the moment.
Set-Item WSMan:\localhost\Client\TrustedHosts –Value * -Force
$Script = {Get-WindowsUpdate -KBArticleID KB4535680 -AcceptAll -Install -Verbose | Out-File C:\Temp\PSWindowsUpdate.log}
Invoke-WUjob -ComputerName <computername> -Script $Script -Confirm:$false -RunNow
- andrefilipe90Oct 11, 2023Copper Contributor
great topic, would you mind sharing the code you got so far and some details of how it works?
cheers.
- dmarquesgnOct 19, 2023Iron Contributor
Hi, how are you?
To be honest, I didn't developed much more on that, as we turned into a low cost but very effective tool for that goal, which was PDQ.