Skip to content

Instantly share code, notes, and snippets.

Martin Matuska hpmmatuska

Block or report user

Report or block hpmmatuska

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hpmmatuska
hpmmatuska / telnet.ps1
Last active Aug 29, 2015
Will create sample connection to remote machine on specified port (as classic telnet client)
View telnet.ps1
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
@hpmmatuska
hpmmatuska / get-ServiceStatus.ps1
Last active Aug 29, 2015
List services, their startup type and current status; optionally action for qeuery results
View get-ServiceStatus.ps1
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
@hpmmatuska
hpmmatuska / SQL_validation.ps1
Last active Aug 29, 2015
The function validate input file (SQL script) for potential dangerous commands. Optional is report and trigger execution.
View SQL_validation.ps1
Function ExecuteSQLscript {
<#
.Synopsis
Execute SQL script
.Description
will trigger sqlexec.exe and display output
.INPUTS
-SQLscript <[System.IO.FileInfo]string>
@hpmmatuska
hpmmatuska / Nagios_Cluster.ps1
Last active Dec 14, 2018
Cluster Monitoring for Nagios. It's monitor Cluster Nodes, Groups, Resources and Prefered Owners. The script is for PS4 (Windows 2012). Earlier windows are missing the method CIM method getpreferedowner -> you need to comment that section.
View Nagios_Cluster.ps1
$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
@hpmmatuska
hpmmatuska / Get-SPWorkflowExecutionStatus
Last active Aug 29, 2015
The function will query the SharePoint web applications or the Site Collection for all the workflows and the result codes. It's useful to have overview about all running workflows due to build-in limits.
View Get-SPWorkflowExecutionStatus
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.
@hpmmatuska
hpmmatuska / Get-RemoteAccessFarmUsage.ps1
Last active Jul 12, 2018
Get active remote connection thru RRAS and RDS Gateway for the specified servers.
View Get-RemoteAccessFarmUsage.ps1
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.
@hpmmatuska
hpmmatuska / Get-FolderSize.ps1
Last active Aug 29, 2015
Get folder sizes with recourse. The output is list of first level directory structure under specified path.
View Get-FolderSize.ps1
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.
@hpmmatuska
hpmmatuska / Get-UptimeParallel.ps1
Last active Aug 29, 2015
Get Uptime for list of computers with basic errorhandling. It's processed in parallel.
View Get-UptimeParallel.ps1
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.
@hpmmatuska
hpmmatuska / Test-MultiConnection.ps1
Last active Aug 29, 2015
Test Connection with multiple features
View Test-MultiConnection.ps1
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
You can’t perform that action at this time.