Skip to content

Instantly share code, notes, and snippets.

View andikrueger's full-sized avatar

Andi Krüger andikrueger

View GitHub Profile
@andikrueger
andikrueger / Get-GraphFunctionCount.ps1
Created July 14, 2023 14:57
Read function count for Microsoft Graph modules used by Microsoft365DSC
$Global:MaximumFunctionCount = 32767
$modules = Get-Module Microsoft.Graph* -ListAvailable
foreach ($module in $modules)
{
Write-Host "Trying to import $($module.Name)"
Write-Host "Module function count $($(Get-Command -Module $module.Name -CommandType Function).Count)"
# Generated by Microsoft365DSC from https://export.microsoft365dsc.com on 5/21/2023, 10:52:22 PM
# Visit https://microsoft365dsc.com for more information
# Getting application information for Application + Certificate authentication
$ApplicationId = Read-Host -Prompt 'Application Id'
$CertificateThumbprint = Read-Host -Prompt 'Certificate Thumbprint'
$TenantId = Read-Host -Prompt 'Tenant Id'
$exportPath = "C:\TenantConfig\"
Install-Module Az.Resources
$permissions = Get-M365DSCCompiledPermissionList -ResourceNameList (Get-M365DSCAllResources) -PermissionType Application -AccessType Read
Update-M365DSCAzureAdApplication -ApplicationName CollabsummitExport -Permissions $permissions -Type Certificate -CreateSelfSignedCertificate -AdminConsent -Verbose -CertificatePath C:\TenantConfig\CollabsummitExportApp.cer
@andikrueger
andikrueger / AutoSpSourceBuilderDsc.ps1
Created April 28, 2020 19:41
This gist shows a proof of concept for a AutoSpSourceBuilder DSC Resource
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
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
#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
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
$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
@{
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
$ConfigurationData.NonNodeData.SqlServerAlias | ForEach-Object -Process {
SqlAlias $_.Name
{
Name = $_.Name
ServerName = $_.ServerName
Protocol = $_.Protocol
UseDynamicTcpPort = $_.UseDynamicTcpPort
TcpPort = $_.TcpPort
Ensure = 'Present'