Software Script

This topic contains 1 reply, has 2 voices, and was last updated by  Michael Bender 4 months, 3 weeks ago.

  • Author
    Posts
  • #67144

    MH2AZ
    Participant

    Hi all,
    I'm just starting Powershell and need some help. I created a new event log to monitor software on a machine.
    I searched for the installed software and took the results and put them into a text file. Here is the part I
    can't figure out and need help on. I want the script to check every 15 minutes to determine if new software has been
    installed. If something is found I want to put it in the event log. I looked at the start-stop cmdlet and also
    a loop to keep the script checking every 15 minutes. Any ideas? Here is what I have thus far. Thanks

    New-EventLog -Logname "SoftwareLog" -Source "Software"
    
    Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, InstallDate, Publisher > C:\Software.txt
  • #67185

    Michael Bender
    Participant

    Probably your best option is to create a script that checks for new applications, and then writes the events desired. Then using the built-in Task Scheduler in Windows to run every 15 minutes. Having a script that is constantly running will be problematic. If you want to try setting up the scheduled task with PowerShell, you can explore the ScheduledTask modules' commands with this command:

    gcm *task* -Module ScheduledTasks
    

You must be logged in to reply to this topic.