Skip to content

Instantly share code, notes, and snippets.

Avatar

Andi Krüger andikrueger

View GitHub Profile
@andikrueger
andikrueger / AutoSpSourceBuilderDsc.ps1
Created April 28, 2020 19:41
This gist shows a proof of concept for a AutoSpSourceBuilder DSC Resource
View AutoSpSourceBuilderDsc.ps1
Configuration AutoSpSourceBuilderDsc {
param (
# SharePoint Patch Name - As Defined by AutoSPSourceBuilder
[Parameter()]
[System.String]
$SharePointPatchName,
# SharePoint Version (2013 or 2016)
[Parameter(Mandatory = $true)]
[Int]
@andikrueger
andikrueger / ScriptResourceHyper-V.ps1
Created January 14, 2019 14:50
Script Resource for configuring Hyper-V Role on Windows 10
View ScriptResourceHyper-V.ps1
Script Hyper-V
{
GetScript = {
Write-Verbose "Get current status for Microsoft-Hyper-V Feature"
$hyperVFeatureState = Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Online -ErrorAction SilentlyContinue
return @{
Result = $hyperVFeatureState
}
}
@andikrueger
andikrueger / TweetDeckSPFxFilter.txt
Last active January 16, 2019 19:46
Please do not hesitate to suggest changes to the filter for tweets related to SharePoint Framework. #SPFx -See: https://github.com/andikrueger/TweetDeckSPFxFilter
View TweetDeckSPFxFilter.txt
#SPFx -#art -#artist -#artistreborn -#behindthescenes -#blood -#Elementary -#hollywood -#LED -#makeup -#makeupeffects -#makeupfx -#mua -#mufx -#pyro -#pyrotechnics -#sfx -#SharpFX -#specialeffects -#specialeffectsmakeup -#specialfx -#specialfxmakeup -#specialmakeupeffects -#specialmakeupfx -#spfmakeup -#spfxmua -#tv -#wounds -from:webpart_o_matic
@andikrueger
andikrueger / SharePoint.ps1
Created January 8, 2019 15:18
How to reuse the SQL Server Alias properly
View SharePoint.ps1
Previously:
SPFarm SharePointFarm
{
DatabaseServer = ¯\_(ツ)_/¯
IsSingleInstance = "Yes"
FarmConfigDatabaseName = "SP_Config"
AdminContentDatabaseName = "SP_AdminContent"
Passphrase = $Passphrase
@andikrueger
andikrueger / SqlServerAlias.New.ps1
Created January 8, 2019 15:14
Creating SQL Server Alias based on a hash table with iteration
View SqlServerAlias.New.ps1
$ConfigurationData.NonNodeData.SqlServerAlias.Keys | ForEach-Object -Process {
SqlAlias $ConfigurationData.NonNodeData.SqlServerAlias[$_].Name
{
Name = $ConfigurationData.NonNodeData.SqlServerAlias[$_].Name
ServerName = $ConfigurationData.NonNodeData.SqlServerAlias[$_].ServerName
Protocol = $ConfigurationData.NonNodeData.SqlServerAlias[$_].Protocol
UseDynamicTcpPort = $ConfigurationData.NonNodeData.SqlServerAlias[$_].UseDynamicTcpPort
TcpPort = $ConfigurationData.NonNodeData.SqlServerAlias[$_].TcpPort
Ensure = 'Present'
@andikrueger
andikrueger / ConfigurationData.New.psd1
Last active January 8, 2019 15:22
SharePoint Configuration Data - new
View ConfigurationData.New.psd1
@{
AllNodes = @(
@{
NodeName = "*"
PSDscAllowPlainTextPassword = $true
PSDscAllowDomainUser = $true
ServerRole = "invalid"
},
@{
NodeName = "SharePointServer"
@andikrueger
andikrueger / SqlServerAlias.Old.ps1
Last active January 8, 2019 15:07
Create a SQL Server Alias basd on Configuration Data
View SqlServerAlias.Old.ps1
$ConfigurationData.NonNodeData.SqlServerAlias | ForEach-Object -Process {
SqlAlias $_.Name
{
Name = $_.Name
ServerName = $_.ServerName
Protocol = $_.Protocol
UseDynamicTcpPort = $_.UseDynamicTcpPort
TcpPort = $_.TcpPort
Ensure = 'Present'
@andikrueger
andikrueger / ConfigurationData.Old.psd1
Last active January 8, 2019 15:22
SharePoint Configuration Data - old
View ConfigurationData.Old.psd1
@{
AllNodes = @(
@{
NodeName = "*"
PSDscAllowPlainTextPassword = $true
PSDscAllowDomainUser = $true
ServerRole = "invalid"
},
@{
NodeName = "SharePointServer"
View SetSharePointTimeZone.ps1
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)
{
@andikrueger
andikrueger / Get-SPUserProfilePropertyMapping.ps1
Created June 24, 2018 17:56
This snippet helps to retrieve the current UserProfilePropertyMapping values for AD Sync Connections
View Get-SPUserProfilePropertyMapping.ps1
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")