Skip to content

Instantly share code, notes, and snippets.

View vMarkusK's full-sized avatar

Markus Kraus vMarkusK

View GitHub Profile
$DAPs = @("DAP01.lan.local","DAP02.lan.local") #MediaSever
$DPCs = @("DPC01.lan.local") #Cell Server
$TempPath = "D:\OmniBackData\tmp" #Path to DP Temp Files
foreach ($DAP in $DAPs) {
Write-Output "Testing $DAP..."
if (Test-WsMan $DAP) {
Write-Output "Processing $DAP..."
Invoke-Command -ComputerName $DAP -ScriptBlock {Get-Service -Name omniInet | Stop-Service}
Invoke-Command -ComputerName $DAP -ScriptBlock {Get-ChildItem $TempPath | Remove-Item -Confirm:$False -Recurse}
@vMarkusK
vMarkusK / myMove-VM.ps1
Last active April 20, 2016 08:13
Moves a VM betwenn vSphere Datacenters. Changes Host, Datastore and Cluster.
<#
.SYNOPSIS
Moves a VM betwenn vSphere Datacenters
.DESCRIPTION
Changes Host, Datastore and Cluster.
.EXAMPLE
myMove-VM.ps1 -VMname "yourVM" -newCluster "yourCluster" -NewDS "yourDS*" -VIServer "yourvCenter.lan.local"
@vMarkusK
vMarkusK / StoreOnce-Report.js
Created April 12, 2016 14:27
Reports StoreOnce Catalyst Stores
var SIDs_Request = RH_XXXXD2D.createRequest("GET", '/storeonceservices/cluster/servicesets/' , null);
SIDs_Request.setHeader('Accept', 'text/xml');
var SIDs_Response = SIDs_Request.execute();
var SIDs_XML = XMLManager.fromString(SIDs_Response.contentAsString);
var SIDs_Elements = SIDs_XML.getElementsByTagName("serviceset");
var SIDs_Count = SIDs_Elements.length;
System.log ("Number of SIDs:" + SIDs_Count + " on " + RH_XXXXD2D.name);
var Stores_Count = 0;
for (var i = 1; i <= SIDs_Count; i++) {
@vMarkusK
vMarkusK / StoreOnce-Report.ps1
Last active June 4, 2019 22:29
Reports StoreOnce Catalyst Stores via RESTapi
# Workaround for SelfSigned Cert
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
@vMarkusK
vMarkusK / PRTG-vCenter.ps1
Last active April 4, 2016 14:44
Advanced Sensor will Report vCenter Statistics about Resource usage.
<#
.SYNOPSIS
PRTG vCenter Advanced Sensor
.DESCRIPTION
Advanced Sensor will Report vCenter Statistics about Resource usage.
.EXAMPLE
PRTG-vCenter.ps1 -VIServer vCenter.lan.local -Check DS
@vMarkusK
vMarkusK / PRTG-VeeamBRStats.ps1
Last active December 12, 2019 01:33
Reports Veeam B&R Statistics via PowerShell for PRTG
<#
.SYNOPSIS
PRTG Veeam Advanced Sensor
.DESCRIPTION
Advanced Sensor will Report Statistics about Backups during last 24 Hours and Actual Repository usage.
.EXAMPLE
PRTG-VeeamBRStats.ps1 -BRHost veeam01.lan.local
$LogPath = "C:\inetpub\logs\LogFiles\W3SVC1\*"
$LogFiles = "*.log"
[int] $LogRetention = "-30" # in Days
Get-ChildItem $LogPath -Include $LogFiles -Recurse | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays($LogRetention)} | Remove-Item
@vMarkusK
vMarkusK / syslog.bat
Last active March 11, 2016 08:43
HP Data Protector Syslog Integration
@ECHO OFF
setlocal
:: global variables
set log=D:\syslog\sessions.log
set maxbytesize=1000
:: cleanup logic
IF NOT EXIST "%log%" GOTO :Write
FOR /F "usebackq" %%A IN ('%log%') DO set size=%%~zA
@vMarkusK
vMarkusK / vCheck VM-DiskReport_IOPS-Limit.ps1
Last active March 6, 2016 10:03
vCheck Plugin to report vSphere VM disks related to Datastores and Max IOPs
# Start of Settings
# Bronze Limit
[int]$B_Limit = "250"
# Silber Limit
[int]$S_Limit = "1000"
# Gold Limit
[int]$G_Limit = "-1"
# VM IOPS Limits, do not report on any VMs who are defined here
$VMTDoNotInclude = "VM01*|VM01*"
# End of Settings
@vMarkusK
vMarkusK / VM-DiskReport_IOPS-Limit.ps1
Last active August 10, 2016 14:28
Reports vSphere VM disks related to Datastores and Max IOPs
<#
.NOTES
===========================================================================
Created by: Markus Kraus
Twitter: @vMarkus_K
Private Blog: mycloudrevolution.com
Organization: Vater Operations GmbH
Organization Site: vater-cloud.de
===========================================================================
Changelog: