Skip to content

Instantly share code, notes, and snippets.

View cloudchristoph's full-sized avatar
Working from home

Christoph Vollmann cloudchristoph

Working from home
View GitHub Profile
cloudchristoph / Add-SharePointSiteExternalUser.ps1
Created September 6, 2016 12:48 — forked from markekraus/Add-SharePointSiteExternalUser.ps1
PowerShell function to invite an external user or list of external users to a SharePoint site
View Add-SharePointSiteExternalUser.ps1
Invites an external user or list of external users to a SharePoint site.
Invites an external user or list of external users to a SharePoint site.
External users can be granted View, Edit, or Owner permissions within
the site. A custom e-mail message can be included or the invitation email
can be suppressed.
URL string of the SharePoint site to which the user(s) will be invited.
View GetCurrentPatchlevel.ps1
[string]$BuildVersion = ""
#Patch-Level der SharePoint Farm prüfen
$apiUrl = ""
if ($BuildVersion -eq "") {
write-host "Lese Farm-Info..." -f Gray
asnp *share*
$BuildVersion = (Get-SPFarm).BuildVersion.ToString()
View BackupAllSites.ps1
[bool]$DateTimePrefix = $true,
[bool]$OverwriteExistingBackups = $false
if ($DateTimePrefix) {
$date_time_prefix = Get-Date -Format "yyMMdd_HHmmss_"
} else {
$date_time_prefix = "";
View RunAllHealthAnalyzerTimerJobs.ps1
asnp *share*
write-host "Getting timerjob definitions..."
$jobs = Get-SPTimerJob | ? {$_.Title -like "Health Analysis Job*"}
if (!$jobs -or $jobs.Count -eq 0) {
# Maybe in German? :)
$jobs = Get-SPTimerJob | ? {$_.Title -like "Integritätsanalyseauftrag*"}
View StartStopDevVMs.ps1
# Change VM names to your own names
$baseVMs = @("ROUTER","AD")
$sqlVMs = @("SPSQL2016")
$sharepointVMs = @("SP2016-1","SP2016-2")
# -------------------------------------------------------------------------------------------------
function Start-VMSet($vmSet){
View MoveSearchComponents_Traditional2Streamlined.ps1
asnp *share*
$wfeServerName = "SP2016-1"
$appServerName = "SP2016-2"
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active
cloudchristoph / DCGracefulShutdown.ps1
Last active July 19, 2017 14:15
Gracefully shutdown the Distributed Cache Instance on the server; SharePoint 2013, SharePoint 2016
View DCGracefulShutdown.ps1
# Source:
# changed it to dynamic hostname
# Run this on the Cache Host that should be stopped
$hostName = [System.Net.Dns]::GetHostByName(($env:COMPUTERNAME)).HostName
$startTime = Get-Date
$currentTime = $startTime
$elapsedTime = $currentTime - $startTime
View GetWebSizes.ps1
function GetWebSizes ($StartWeb)
$web = Get-SPWeb $StartWeb
[long]$total = 0
$total += GetWebSize -Web $web
$total += GetSubWebSizes -Web $web
$totalInMb = ($total/1024)/1024
$totalInMb = "{0:N2}" -f $totalInMb
$totalInGb = (($total/1024)/1024)/1024
$totalInGb = "{0:N2}" -f $totalInGb
cloudchristoph / Update-AzModules.ps1
Created May 28, 2020 07:18
Script for updating all AZ PowerShell Modules at once
View Update-AzModules.ps1
# Source:
# Author: Robert Smit
Get-Module -Name az.* -ListAvailable |
Where-Object -Property Name -ne 'Az.' |
ForEach-Object {
$currentVersion = [Version] $_.Version
$newVersion = [Version] (Find-Module -Name $_.Name).Version
if ($newVersion -gt $currentVersion) {
Write-Host -Object "Updating $_ Module from $currentVersion to $newVersion"
Update-Module -Name $_.Name -RequiredVersion $newVersion -Force
cloudchristoph / mytemplate.bicep
Created September 6, 2020 10:40
Azure Bicep - Erstes Template
View mytemplate.bicep
param location string = resourceGroup().location
param environment string = 'dev'
param appName string = 'myapp'
var storageAccountName = 'st${appName}${environment}'
resource MyStorageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = {
name: storageAccountName
location: location
kind: 'Storage'
sku: {