Jump to content

Custom Tools-Remote Powershell commands


Recommended Posts

Hi, Is it possible to remotely execute powershell commands from KSC custom tools? I found this topic but it didn't help me: https://forum.kaspersky.com/index.php?app=forums&module=forums&controller=topic&id=382442&tab=comments#comment-2751988 I need to launch some powershell commands, for example a software list like this: Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize > D:\swlist.txt Other example, pending updates. $update = new-object -com Microsoft.update.Session $searcher = $update.CreateUpdateSearcher() $pending = $searcher.Search("IsInstalled=0") foreach($entry in $pending.Updates) { Write-host "Title: " $entry.Title Write-host "Downloaded? " $entry.IsDownloaded Write-host "Description: " $entry.Description foreach($category in $entry.Categories) { Write-host "Category: " $category.Name } Write-host " " } Thank you
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...