Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

January 2022

VIDEO – PNP Site Directory JSON expanded with AzureAD site owner

Demo how to create JSON inventory of full tenant SPO site collections. Lookup Site Owner in Azure AD and expand JSON with AD properties such as user, manager, department, and more. Cheers.

CODE

https://github.com/spjeff/office365/blob/master/office365-site-directory/PnP-Site-Directory-JSON.ps1

VIDEO

SCREENSHOTS

REFERENCE

Auto Detect PowerShell Azure Runbook (or Local) Runspace

Wanted to share quick code snippet for how to detect if current PS1 host environment is Azure RUNBOOK or LOCAL console like POWERSHELL_ISE or POWERSHELL.EXE. Cheers.

SCREENSHOT

CODE

if ($host.Runspace) {if ($host.Runspace[0].GetType().Name -eq “LocalRunspace”) {$local=$true; “LOCAL”}} else {“RUNBOOK”}

REFERENCE

https://docs.microsoft.com/en-us/powershell/scripting/developer/hosting/windows-powershell-host-quickstart?view=powershell-7.2

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲