The script is made as a proof-of-concept to make speedy asynchronos ping over a range (array) of IP-addresses.
It is made for speed over quality, use-case is frequent monitoring checks where a gap or two is OK,
and only pings each IP in the array once.
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
<# | |
Script will generate a json file listing management packs and | |
the servers (computers) with instances from that management pack | |
ex. | |
{ | |
"Management.Pack.Name.1": [ | |
"server1.principal.name", | |
... | |
"server2.principal.name" |
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-CoffeeRatio { | |
param([float]$g, [float]$ml) | |
for($i = $g; $i -gt 1;$i--) { | |
$mlmod = $ml % $i | |
$gmod = $g % $i | |
if ($mlmod -eq 0 -and $gmod -eq 0) { | |
$g = $g / $i | |
$ml = $ml / $i | |
break |
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
Set-PSDebug -Strict | |
function Get-SCOMFailoverResourcePools | |
{ | |
[CmdletBinding()] | |
Param | |
( | |
# Param1 help description | |
[Parameter(Mandatory=$true, | |
ValueFromPipelineByPropertyName=$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
function Get-SQLCUKBProductVersion ($url) { | |
$wr = Invoke-WebRequest -UseBasicParsing -Uri $url | |
$wrContent = $wr.RawContent | |
$matchFound = $wrContent -match "<table.*?>(.*)</table>?" #extracting tables | |
## This is the table we're looking for | |
# <table class="table ng-scope"> | |
# <tbody> | |
# <tr> |
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 | |
Executes a single AsyncPing on each Address in -AddressList | |
.DESCRIPTION | |
Takes a list (array) of addresses, IP or DNS-Names, and performs a single AsyncPing against the target. | |
This CmdLet is made to do quick and dirty fast pings against a larger number of targets. | |
.EXAMPLE | |
# Ping www.teknoglot.se and www.google.se, 5s timeout | |
Test-AsyncPing -AddressList "www.teknoglot.se","www.google.se" -Timeout 5000 | |
.EXAMPLE |
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( | |
[Parameter(Mandatory=$true)] | |
[string] $MPPrefix | |
,[Parameter(Mandatory=$true)] | |
[string] $MPSearchString | |
,[Parameter(Mandatory=$true)] | |
[string] $ManagementPackDisplayName | |
) |
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
import-module -name operationsmanager | |
New-SCOMManagementGroupConnection | |
$alerts = Get-SCOMAlert -ResolutionState 0 | ?{($_.IsMonitorAlert -eq $false) -and ($_.RepeatCount -eq 0)} | |
Set-SCOMAlert -Alert $alerts -ResolutionState 255 |
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
-- This Script will find probable orphaned servers in the | |
-- OMDB BaseManagedEntity database. | |
-- Replace 'PREFIX[0-9]%.domain.fqdn' with whatever pattern matching that suits your naming standard. | |
-- A server with only an agent will still have more than one row, | |
-- same goes for cluster names/virtual names. | |
with | |
ServerRowCount as ( | |
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
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory=$true)][string] $HostName, | |
[Parameter(Mandatory=$true)][string] $DomainName, | |
[Parameter(Mandatory=$true)][string] $UserName, | |
[Parameter(Mandatory=$true)][string] $Password, | |
[Parameter(Mandatory=$true)] | |
[ValidateSet("omi","scx")] | |
[string] $AgentType, | |
[switch] $WhatIf |
NewerOlder