This file contains 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
Function Get-PRTGPausedDevice{ | |
[CmdletBinding()] | |
Param( | |
$PRTGURL = "prtg.yourcompany.com", | |
$Username = "youruser", | |
$Passhash = "yourpasshash", | |
$Name, | |
$Message, | |
[int]$DaysPaused #Use -1 to filter for where date is unknown and 0 to return all | |
) |
This file contains 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(SupportsShouldProcess = $true,ConfirmImpact='High')] | |
Param( | |
$PRTGURL = "https://{your PRTG URL}/api", | |
$Auth = "username={your PRTG user}&passhash={your PRTG password hash}", | |
$Name = "", | |
$Message = "", | |
[int]$DaysPaused = 7 #Use -1 to filter for where date is unknown and 0 to return all | |
) | |
$Devices = $null |
This file contains 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 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
( @(53,88,135,389,636,3268) | Sort-Object | Out-String | ForEach-Object{$_ -replace '\n', ','} ).TrimEnd(',') |
This file contains 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("Dublin","London”,"Tokyo","Sydney","")][string]$location | |
) | |
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 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 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
# Example usage: | |
# Get-RDPUser | Disconnect-RDPUser -WhatIf | |
Function Get-RDPUser { | |
[CmdletBinding()] | |
Param() | |
query user | Select -Skip 1 | ForEach-Object { | |
$_ = $_ -split "\s\s+" |
This file contains 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 ( | |
$Paths = (Import-CSV "Paths.csv") | |
) | |
$i = 0 | |
$Total = 0 | |
$Paths | ForEach-Object { | |
This file contains 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( | |
[CmdletBinding(SupportsShouldProcess = $true)] | |
$Inputfile | |
) | |
Import-CSV Credentials.csv | ForEach-Object { | |
$Body = "Dear $($_.GivenName), | |
This file contains 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
$requestBody = Get-Content $req -raw | |
$requestBody = $requestBody.Replace('&',"`n") | |
$requestBody = ConvertFrom-StringData -StringData $requestBody | |
$Response = (Import-CSV "D:\home\site\wwwroot\Glossary\Glossary.csv") | Where-Object {$_.Term -like "$($requestBody.text)*"} | |
if(!$Response){Out-File -Encoding Ascii -FilePath $res -inputObject "Sorry, there is no match in the Glossary for *$($requestBody.text)*."} | |
$Response | ForEach-Object{ | |
Out-File -Encoding Ascii -FilePath $res -inputObject "*$($_.Term):* $($_.Description)" -Append |
OlderNewer