powershell Tag

It's just fantastic how hard it is to call the Graph API REST endpoints through PowerShell. I couldn't let loose from this - from my point of view - big issue and went from problem to solution.TL;DRThe script: O365-Azure-Scripts/Get-StaleUsersReport.ps1 at master · engineererr/O365-Azure-Scripts (github.com).Quickly I...

To get all possible enum values you can follow this blog post from PowerShellMagazine.To make things even easier, you can call GetEnumValues() directly on the returned object from GetType().Get Enum Values in Action ...

Connect-PnPOnline -Url https://[tenant]-admin.sharepoint.com# get the hub site id $hubSite = Get-PnPTenantSite "https://[tenant].sharepoint.com/sites/intranet" $hubSiteId = $hubSite.HubSiteId# get all sites associated to the hub $sites = Get-PnPTenantSite -Detailed $sites | select url | % { $s = Get-PnPTenantSite $_.url if($s.hubsiteid -eq $hubSiteId){ write-host $s.url ...

A customer of mine had some requirements concerning the style of the SuiteBar. That's the black line in the top of the screenshot below. The premises were to not use JavaScript or Master Page customizations.Only option was using PowerShell.I got the SPWebApplication object by doing...

I was inspired by Stefan Gossner who uses PowerShells ability to compile C# code in-memory. This allowed me to run SharePoint CSOM code directly in PowerShell.Stefan's post is definitely worth reading. Here it is.The following script runs on a SharePoint Server. To run it...