This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Requires -version 2.0 | |
| [CmdletBinding()] | |
| param ( | |
| [ValidateSet("London","Berlin","Tokyo","")][string]$location | |
| ) | |
| Write-Host ("`n" * 5) | |
| Import-Module ActiveDirectory -Cmdlet get-adcomputer | |
| $Servers = get-adcomputer -filter {Enabled -eq $true -and OperatingSystem -Like "Windows*"} -property Enabled,OperatingSystem | ?{$_.DistinguishedName.contains($location)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [CmdletBinding()] | |
| Param( | |
| $PRTGURL = "https://{your prtg URL}/api", | |
| $Auth = "username={your prtg user}&passhash={your prtg password hash}" | |
| ) | |
| $Sensors = "" | |
| $Sensors = (invoke-restmethod "$PRTGURL/table.json?content=sensors&output=json&columns=objid,probe,group,device,sensor,status&count=10000&filter_type=httptransaction&$Auth").sensors | |
| $i = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [CmdletBinding()] | |
| Param( | |
| $PRTGURL = "https://{your PRTG URL}/api", | |
| $Auth = "username={your username}&passhash={your password hash}", | |
| $SensorType = "ping" | |
| ) | |
| $Sensors = "" | |
| $Sensors = (invoke-restmethod "$PRTGURL/table.json?content=sensors&output=json&columns=objid,probe,group,device,sensor,status&count=10000&filter_type=$SensorType&$Auth").sensors |
NewerOlder