Skip to content

Instantly share code, notes, and snippets.

View rheid's full-sized avatar

Ralf Heid rheid

View GitHub Profile
@rheid
rheid / get-spversion.ps1
Created February 8, 2016 20:42
PowerShell script to display version info for installed SharePoint product and language packs
# PowerShell script to display SharePoint products from the registry.
Param(
# decide on whether all the sub-components belonging to the product should be shown as well
[switch]$ShowComponents
)
# location in registry to get info about installed software
$RegLoc = Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall
@rheid
rheid / openwindowssqlserverfirewall.ps1
Created January 12, 2016 16:47
Open Windows Firewall for SQL Server 2014
Write-host ========= SQL Server Ports ===================
Write-host Enabling SQLServer default instance port 1433
#netsh firewall set portopening TCP 1433 "SQLServer"
New-NetFirewallRule -DisplayName "Allow inbound TCP Port 1433" –Direction inbound –LocalPort 1433 -Protocol TCP -Action Allow
New-NetFirewallRule -DisplayName "Allow outbound TCP Port 1433" –Direction outbound –LocalPort 1433 -Protocol TCP -Action Allow
@rheid
rheid / createAzureStrogeAccount.ps1
Created December 7, 2015 13:27
Create AzureStorage with Container and upload a File
#begin
# Update with the name of your subscription.
$SubscriptionName="YourSubscriptionName"
# Give a name to your new storage account. It must be lowercase!
$StorageAccountName="yourstorageaccountname"
# Choose "West US" as an example.
$Location = "West US"
@rheid
rheid / makecab.ps1
Created October 16, 2015 15:02
Creating .CAB files with Powershell
<#
.SYNOPSIS
Creates a new cabinet .CAB file on disk.
.DESCRIPTION
This cmdlet creates a new cabinet .CAB file using MAKECAB.EXE and adds
all the files specified to the cabinet file itself.
.PARAMETER Name
The output file name of the cabinet .CAB file, such as MyNewCabinet.cab.
@rheid
rheid / setupspsearchtopo.ps1
Created October 15, 2015 09:35
Setup SharePoint SearchTopologie
$IndexLocation = "d:\index"
#$SearchSA = New-SPEnterpriseSearchServiceApplication -Name $SearchSAName -ApplicationPool $SaAppPoolName -DatabaseServer $SQLAliasName -DatabaseName $dbSearchDatabase
$SearchSA = Get-SPEnterpriseSearchServiceApplication
$SearchInstance = Get-SPEnterpriseSearchServiceInstance -Local
Write-Host "Defining the Search Topology…”
$InitialSearchTopology = $SearchSA | Get-SPEnterpriseSearchTopology -Active
$NewSearchTopology = $SearchSA | New-SPEnterpriseSearchTopology
Write-Host "Creating Admin Component…”
@rheid
rheid / clearinbox.js
Created July 1, 2015 10:32
clear all yammer messages
var goBack = function() {
history.back();
setTimeout(clickLink, 400);
}
var clickLink = function() {
var $element = jQuery('.yj-unread-item a:first');
var $moreLink = jQuery('#moreButton button');
if ($element.length) {
$element.click();
setTimeout(goBack, 400);
@rheid
rheid / Provider.ts
Created June 1, 2015 18:16
AngularJS Typed Script Provider
// Interface describing the members that the provider's service offers
interface IGreetingService {
getGreeting(): string;
}
// The following class represents the provider
class GreetingService implements ng.IServiceProvider {
private greeting = "Hello World!";
// Configuration function
@rheid
rheid / SetupNLB.ps1
Created May 8, 2015 10:36
Setup Windows Server NLB
# Install Network Load Balancing and Tools
Write-Host "Install Network Load Balancing and Tools"
Add-WindowsFeature NLB, RSAT-NLB
Import-Module NetworkLoadBalancingClusters
# If the cluster hasn't been created yet then create it
if (!(Get-NlbCluster -HostName $clusterIpAddress -ErrorAction SilentlyContinue))
{
Write-Host "Creating NLB Cluster: $clusterName" -ForegroundColor yellow
@rheid
rheid / addContentHub.ps1
Last active August 29, 2015 14:18
SharePoint ContentType hub PowerShell cmdlet
# Description: Creates a ContentType hub site collection and configures the managed metadata service application
#
# hubURI: URL of the ContentType hub site collection (mandatory)
# hubOwner: Owner of the hub (default: current user)
# MMSAName: Name of the Managed Metadata service application (default: first found instance of MMS)
# Overwrite: Overwrites hub site collection if it already exists (default: false)
# Confrim: Confirm when existing hub is removed (default: true)
#
# Examples:
#
@rheid
rheid / SPFastCU.ps1
Created March 22, 2015 21:27
Fast Install of SharePoint CU Updates
<# ==============================================================
//
// Microsoft provides programming examples for illustration only,
// without warranty either expressed or implied, including, but not
// limited to, the implied warranties of merchantability and/or
// fitness for a particular purpose.
//
// This sample assumes that you are familiar with the programming
// language being demonstrated and the tools used to create and debug
// procedures. Microsoft support professionals can help explain the