When using Altiris you often find that some computers have a bunch of updates pending, but the users are always putting them off. The script below is what I have used to force an Altiris update cycle on a remote system:
#Update with a list of computers / IPs you want to update $Computers = "computer1","computer2"
foreach($c in $Computers){ # check if the computer is on before trying to install updates if(Test-Connection -ComputerName $c -Quiet){
# execute remote update cycle psexec \\$c powershell.exe -Command "cd 'C:\Program Files\Altiris\Altiris Agent\Agents\PatchMgmtAgent'; ./aexpatchutil.exe /Xa /q" } }
Note:
- You will need to run the script as an administrator that has access to the remote system
- You need to have pstools installed: https://learn.microsoft.com/en-us/sysinternals/downloads/pstools
You can also update the script above to run an inventory by using the /I flag. Check out the AexPatchUtil.exe command line switches here:https://knowledge.broadcom.com/external/article/181828/aexpatchutilexe-command-line-options-and.html
No comments:
Post a Comment