→ 🚀Are you a Lansweeper Champion?! Join our Contributor Program Sign up here!

Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Andy_Sismey
Champion Sweeper III
Powershell example
This is a action script which queries the remote asset and gathers the status of Windows Updates and displays them in Notepad, save the powershell script in your script area within "DefaultPackageShare$"

Powershell Script check-updates.ps1:

$Computername=$args[0]


$query=Get-HotFix -ComputerName $Computername

$query| Export-Csv -NoType "c:\temp\$computername-WindowsUpdates.csv"
$FileLocation="c:\temp\$computername-WindowsUpdates.csv"
Start-Process notepad $FileLocation


Add Asset Action with the following, amend your path to the script:


powershell -noprofile -ExecutionPolicy bypass -command //SERVER/defaultpackageshare$/scripts/check-updates.ps1 {computer}
0 REPLIES 0

Archive

This board contains archived posts from the retired Lansweeper Forum and Insiders Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now