Skip to content

Instantly share code, notes, and snippets.

Anatoly Mironov mirontoli

Block or report user

Report or block mirontoli

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View update-site-locale-pnp.ps1
$web = Get-PnPWeb
$ctx = Get-PnPContext
$tz = $web.RegionalSettings.TimeZones.GetById(4) # Stockholm, UTC+1
$web.RegionalSettings.Timezone = $tz
$web.RegionalSettings.LocaleId = 1053 # Swedish
$web.RegionalSettings.FirstDayOfWeek = 1 # Monday
$web.RegionalSettings.Time24 = $true
View pnp.ps1
# Install
Install-Module SharePointPnPPowerShellOnline -Scope CurrentUser
# check version
Get-Module SharePointPnPPowerShell* -ListAvailable | Select-Object Name,Version | Sort-Object Version -Descending
# Update
Update-Module SharePointPnPPowerShell*
# connect with mfa
Connect-PnPOnline -Url -SPOManagementShell -ClearTokenCache
# get template; you need to extract it, it is just a zip file
Get-PnPProvisioningTemplate -out template.pnp

Schema Extensions

get a schema extension details

GET$filter=id eq '<extension_id>'

get a group

GET$filter=mailNickname eq 'tolle010'
- master
vmImage: 'ubuntu-latest'
buildConfiguration: 'Release'
View spo.ps1
#Connect Disconnect
$userCredential = Get-Credential -UserName $adminUPN -Message "Type the password.";
Connect-SPOService -Url https://$ -Credential $userCredential;
Connect-SPOService -Url -Credential (Get-Credential -UserName -Message "psw")
View disable-group-creation.ps1
$newSetting = Get-AzureADDirectorySetting | ? { $_.DisplayName -eq "Group.Unified" }
$settingsObjectID = $
$settingsCopy = Get-AzureADDirectorySetting -Id $settingsObjectID
$settingsCopy["EnableGroupCreation"] = $false
$creatorsGroup = Get-AzureADGroup -SearchString "Creators"
$settingsCopy["GroupCreationAllowedGroupId"] = $creatorsGroup.ObjectId
Set-AzureADDirectorySetting -Id $settingsObjectID -DirectorySetting $settingsCopy
View schema-extension.ps1
# @mirontoli
# A schema extension is always connected to an application
$dummyApp = New-AzureADApplication -DisplayName "My Properties Bag" -IdentifierUris "https://dummy"
$objectId = $dummyApp.ObjectId
New-AzureADServicePrincipal -AppId $dummyApp.AppId
New-AzureADApplicationExtensionProperty -ObjectId $dummyApp.ObjectId -Name "MyNewProperty" -DataType "String" -TargetObjects "User"
# e85def52-0f7b-44b7-a5fc-bfe72f909682 extension_9e715f8ddb8f4350a8b29b9e76561abc_MyNewProperty {User}
View group-naming-policy.ps1
# @mirontoli, 2019-04-01, run line by line, just a test. takana15
Install-Module AzureADPreview -Scope CurrentUser
Import-Module AzureADPreview
$template = Get-AzureADDirectorySettingTemplate | ? { $_.DisplayName -eq "Group.Unified" }
$settingsCopy = $template.CreateDirectorySetting()
New-AzureADDirectorySetting -DirectorySetting $settingsCopy
$newSetting = Get-AzureADDirectorySetting | ? { $_.DisplayName -eq "Group.Unified" }
$settingsObjectID = $
mirontoli / user-aliases.cmd
Created Jun 5, 2018
My cmder user-alias additions
View user-aliases.cmd
repos=cd %HOME%/source/repos
View configure-wfm.ps1
# this script is generated by workflow manager configuration wizard
# I have extracted variables to parameters
# an alternative to this script can be found on
# Rob Garret's blog:
# Author @mirontoli 2018-04-24
# an example of usage:
# .\configure-wfm.ps1 -dbServer SPWorkFlow -dbPrefix dev_ -spServiceAcctName contoso\wfm_service -spServiceAcctPWD "P@ssword" -passphrase "Blablabal"
You can’t perform that action at this time.