Jump to content

dbeckwitt

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by dbeckwitt

  1. I've written a script to scan the network and insert all existing active IP addresses to the proper location in the registry, however Pulseway manager doesn't pick that up (even on service restart).
    Where do I need to insert those changes?

    Sample script below- It relys on a txt file for a list of active IP's (generated separately)

     

    cls
    # Remove any existing registry entries
    $ExistingKeys = Get-ChildItem "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\" | Select-Object -expand Name
    $Count = 0
    ForEach ($Key in $ExistingKeys){
      Remove-Item "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count"
      $Count++
     }

    #Load List of IP's to monitor and insert values into registry
    $IPList = Get-Content "C:\updates\IPList.txt"
    $Count = 0;
    foreach ($IP in $IPList) {
        New-Item "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count";
        Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("Address") -Type String -Value $IP;
        Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("AliasName") -Type String -Value "Camera $Count";
        Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("Priority1") -Type String -Value 2;
        Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("Priority2") -Type String -Value 1;
        Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("ResponseMinutes") -Type String -Value 1;
        Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("ResponseTime") -Type String -Value 300;
        Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("UseAlias") -Type String -Value 0;
        $Count++
        
        }

    exit 0;

     

×
×
  • Create New...