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 Test-Port { | |
<# | |
.Synopsis | |
Do a test for open ports against remote machine | |
.Description | |
Will create sample connection to remote machine on specified port (as classic telnet client) | |
.Parameter Computername | |
The name of the computer to query. The Input can be piped, it is default 1st parameter |
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-ServiceStatus { | |
<# | |
.Synopsis | |
List services, their startup type and current status. | |
.Description | |
This command will query the Win32_Service class using Get-WmiObject and return list of services. | |
.Parameter | |
Computername - The name of the computer to query. This parameter has an alias of CN. The Input can be piped. | |
Service - query for service name, supports wildcards |
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 ExecuteSQLscript { | |
<# | |
.Synopsis | |
Execute SQL script | |
.Description | |
will trigger sqlexec.exe and display output | |
.INPUTS | |
-SQLscript <[System.IO.FileInfo]string> |
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
$Status= 0 | |
# 0-OK | |
# 1-Warning | |
# 2-Error | |
# 3-Unknown | |
$ItemName = $null | |
# This has to be unique per host in NAGIOS | |
$PerfData = '-' | |
# varname=value;warn;crit;min;max |
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 mms-SPRunningWorkflows { | |
<# | |
.Synopsis | |
List of running workflows for the site | |
.Description | |
Due to running worfklows you can face to various .Net compilation errors. The most know are: | |
- Could not write to output file ... The Directory is invalid | |
- The workflow can not run and will be saved only | |
- etc. |
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 mms-RAFarm { | |
<# | |
.Synopsis | |
Get active remote connection thru RRAS and RDS Gateway for the specified servers. | |
.Description | |
This command will query the Win32_TSGatewayConnection class using RPC and root/Microsoft/Windows/RemoteAccess using WinRM | |
and write summary object to the pipeline. | |
.Parameter Computername | |
The name of the computer(s) to query. This parameter has an alias of CN. The Input can be piped. |
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 mms-FolderSize { | |
<# | |
.Synopsis | |
The function will return folder size and list of first level subfolders size. | |
.Description | |
The function is simmilar to reskit command "diruse" or unix tool "du". The output is sum value of file sizes | |
in specified folder and summary siza for each first level subfolder. The function is build up on top of | |
get-childitem function. |
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-Uptime { | |
<# | |
.Synopsis | |
Get computer uptime. | |
.Description | |
This command will query the Win32_OperatingSystem class using Get-CimInstance and write an uptime object to the pipeline. | |
The function is calling workflow to parallely process all inputs to save some time. | |
.Parameter Computername | |
The name of the computer(s) to query. This parameter has an alias of CN. The Input can be piped. |
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 Test-Ping { | |
<# | |
.Synopsis | |
Do a simple conncetion test (ping) to specified hosts. | |
.Description | |
The command will run "test-connection" again hosts defined in variable. If Single host is specified, | |
there will run continuos ping, otherwise one packet will be send to all hosts in paralel. The pipe input is supported. | |
.Parameter ComputerName | |
The destination name or IP addresses | |
alias: name, cn |