Skip to content

Instantly share code, notes, and snippets.

View andikrueger's full-sized avatar

Andi Krüger andikrueger

View GitHub Profile
@andikrueger
andikrueger / ngOfficeUiFabric_messagebar.js
Created May 25, 2016 10:01
ngOfficeUiFabric javascript with the new messagebar component
/*!
* ngOfficeUIFabric
* http://ngofficeuifabric.com
* Angular 1.x directives for Microsoft's Office UI Fabric
* https://angularjs.org & https://dev.office.com/fabric
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("angular"));
else if(typeof define === 'function' && define.amd)
@andikrueger
andikrueger / SharePointMultiSync.psm1
Last active March 15, 2018 09:37
This is a enhanced version of SharePointSync.psm1 (source: https://github.com/SharePoint/PnP-Tools/tree/master/Solutions/UserProfile.MIMSync). The latest MIM SP is supported with this version and it's possible to create multiple Management Agents for SharePoint.
$namespace = @{dsml="http://www.dsml.org/DSML"; 'ms-dsml'="http://www.microsoft.com/MMS/DSML"}
function Install-SharePointSyncConfiguration {
<#
.Synopsis
Configures the Synchronization Service for SharePoint User Profile Synchronization
.DESCRIPTION
Long description
.EXAMPLE
@andikrueger
andikrueger / PhpWinCacheExtension.ps1
Last active December 19, 2017 09:49
PowerShell DSC Script Resource to configure php_wincache.dll extension in php.ini file
Script PhpWinCache {
GetScript = {
return @{
Result = ""
}
}
TestScript = {
$iniFile = "$($phpDirectory)\php.ini"
$currentStatus = Select-String -Path $iniFile -Pattern "^extension=php_wincache.dll"
Write-Debug "$($currentStatus)"
@andikrueger
andikrueger / IISInstallationDSC.ps1
Last active April 3, 2020 08:29
Installs all basic Windows Features for IIS and disables the default IIS Pools and Site; Initial PHP Setup
$features = @("Web-Server",
"Web-Mgmt-Tools",
"web-Default-Doc",
"Web-Dir-Browsing",
"Web-Http-Errors",
"Web-Static-Content",
"Web-Http-Logging",
"web-Stat-Compression",
"web-Filtering",
"web-CGI",
Package MySqlInstaller {
Path = "$($SourceFolder)\mysql-installer-community-5.7.20.0.msi"
ProductId = "{7999380B-7D4E-4E76-B61D-3AFCA710F24D}"
Name = "MySQL Installer - Community"
Arguments = ""
}
Package vcRedist2013 {
Path = "$($SourceFolder)\vcredist_x64.exe"
ProductId = "{ef6b00ec-13e1-4c25-9064-b2f383cb8412}"
@andikrueger
andikrueger / PiwikWithSharePointMinimalDownloadStrategy.js
Created February 14, 2018 12:34
This gist provides a basic implementation on how you can use Piwik in a MDS enabled Site Collection
var SpPiwik;
(function (SpPiwik) {
SpPiwik.init = function () {
window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
window._paq.push(['enableLinkTracking']);
window._paq.push(['trackPageView']);
(function () {
var u = "//piwikserver.domain.de/";
window._paq.push(['setTrackerUrl', u + 'piwik.php']);
@andikrueger
andikrueger / Matomo(Piwik)WithSharePointSearchCenter.js
Created February 14, 2018 12:46
This gist provides a basic implementation on how you can use Matomo (Piwik) in a Search Site Collection
var SpPiwik;
(function (SpPiwik) {
SpPiwik.init = function () {
window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
window._paq.push(['enableLinkTracking']);
if (typeof window._spPageContextInfo !== 'undefined'
&& window._spPageContextInfo.webServerRelativeUrl === '/suche'
&& typeof window.Srch !== 'undefined') {
window._paq.push(['trackSiteSearch',
@andikrueger
andikrueger / Get-SharePointLanguages.psm1
Last active February 26, 2018 21:37
Get SharePoint 2016 base language and language packs. For more details see: https://andikrueger.wordpress.com/2018/02/26/sharepoint-2016-base-language-and-language-packs/
#Requires -RunAsAdministrator
function Get-SharePointLanguages
{
$baseLanguageKey = Get-Item 'HKLM:\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\16.0\ServerLanguage'
$baseLanguageValue = $baseLanguageKey.Property
if($null -ne $baseLanguageValue -and $baseLanguageValue.Count -eq 1)
{
$baseLanguageCulture = New-Object System.Globalization.CultureInfo([int]$baseLanguageValue[0])
Write-Host "SharePoint base language:" -ForegroundColor Green
@andikrueger
andikrueger / Get-SPUserProfilePropertyMapping.ps1
Created June 24, 2018 17:56
This snippet helps to retrieve the current UserProfilePropertyMapping values for AD Sync Connections
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$caURL = (Get-SPWebApplication -IncludeCentralAdministration | Where-Object -FilterScript {
$_.IsAdministrationWebApplication -eq $true
}).Url
$context = Get-SPServiceContext -Site $caURL
$userProfileConfigManager = New-Object -TypeName "Microsoft.Office.Server.UserProfiles.UserProfileConfigManager" `
-ArgumentList $context
$connection = $userProfileConfigManager.ConnectionManager["AD"]
if($connection.Type -eq "ActiveDirectoryImport")
if($null -eq $adminCred)
{
$adminCred = Get-Credential -UserName "" -Message "Gloabl SharePoint Admin Login for Office 365"
}
if($null -eq $tenantName)
{
$tenantName = Read-Host "Please Enter your TenantName"
}
if($null -eq $timeZoneId)
{