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
#Performs a simple Ping test to the default destination of internetbeacon.msedge.net | |
Test-NetConnection | |
#Performs a Ping test to google.com | |
$Ping = Test-NetConnection -ComputerName google.com | Select * | |
#Performs a Traceroute test to google.com | |
$TraceRt = Test-NetConnection -ComputerName google.com -TraceRoute | |
$TraceRt | Select * |
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
# 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
Describe 'My process checks' { | |
Context 'Checking essential Windows processes are running' { | |
It 'winlogon.exe is running' { | |
get-process -Name 'winlogon' | Should be $true | |
} | |
} |
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( | |
$limit = (Get-Date).AddDays(-7), | |
$path = "C:\Example\Path" | |
) | |
# Delete files older than the $limit. | |
$FilesToDelete = (Get-ChildItem -Path $path -Exclude Logs | Where-Object { $_.LastWriteTime -lt $limit }) | Select Path | |
# If files are deleted create a log detailing this |
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
Param( | |
$SEPLatestVersion = "12.1.7" | |
) | |
Describe 'Symantec Endpoint Protection checks' { | |
Context 'SEP service checks' { | |
$SEPServices = @('SepMasterService','SmcService') |
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
Get-WmiObject Win32_logicaldisk | Export-Clixml "$env:computername-LogicalDisks.xml" | |
(Get-Service | select name,displayname,status) | Export-Clixml "$env:computername-Services.xml" | |
(Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object {$_.IPEnabled -eq "True"}) | Export-Clixml "$env:computername-Network.xml" |
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
<# | |
.Synopsis | |
Glossary Module | |
.DESCRIPTION | |
A Powershell Module that includes a function for searching a CSV file which is a Glossary of terms and presents the results in a variety of formats. | |
.EXAMPLE | |
Search-Glossary MyTerm | |
.EXAMPLE | |
Search-Glossary MyTerm -PassThru | Export-CSV MyTerms.csv | |
#> |