powershell
228 TopicsObtain Deleted Stats (SharePoint) by Retention Policy
I've scoured: Identify the available PowerShell cmdlets for retention | Microsoft Learn and the Unified Audit Log (Using Search-UnifiedAuditLog in Powershell: All You Need To Know, How to Query Microsoft 365 Audit Logs using PowerShell – TheITBros) to see if I can come up with a method to obtain some statistics regarding how many files and space (storage) has been freed up with the use of retention policies being enabled. I'm drawing a blank. In an ideal world, I'd like know how many files have been deleted by the system (the system enforcing a 5 Year from last modified Date and Delete Policy) for the last year or 6 month intervals. If possible the corresponding volume of storage space recovered from these deletions. Any ideas?41Views0likes2CommentsUpdate #9 for Automating Microsoft 365 with PowerShell eBook
The Automating Microsoft 365 with PowerShell eBook is now at update #9. The latest update spans 300 pages of content covering how to use PowerShell with the Microsoft 365 workloads, including Exchange Online, SharePoint Online, OneDrive for Business, Teams, Planner, and Entra ID. There’s no other book that includes so many worked-out examples of how to get things done with PowerShell and Microsoft 365. https://office365itpros.com/2025/02/18/automating-microsoft-365-with-powershell9/83Views0likes1CommentHow to Report the Sponsors for Entra ID Guest Accounts
Entra ID populates the sponsor property for new guest accounts with details of the person who invites the guest to the tenant. It’s data that can be used for different purposes, such as having someone to justify the continued presence of a guest account in a Microsoft 365 tenant. This article explains how to report guest accounts and their sponsors with some straightforward PowerShell. https://office365itpros.com/2025/04/18/guest-accounts-sponsors/26Views0likes0CommentsMicrosoft Attempts to Fix Microsoft Graph PowerShell SDK Problem with Azure Automation
V2.26 and V2.26.1 of the Microsoft Graph PowerShell SDK were low-quality, buggy disasters. Microsoft aims to fix the problem in the next version to make it possible for the SDK to work with Azure Automation runbooks again and address many of the obvious problems that should never have appeared outside Microsoft. It will take time for customer confidence to be restored. https://office365itpros.com/2025/04/14/microsoft-graph-powershell-sdk-2261/42Views0likes0CommentsCreate SharePoint Files from Azure Automation Runbooks
In this Practical Graph article, we describe how to create SharePoint files using an Azure Automation runbook. The code uses the Microsoft Graph PowerShell SDK whenever possible, but we had to resort to Graph API requests at times. We also look at how to update document metadata for the newly uploaded files. https://practical365.com/create-sharepoint-files-azure-automation/71Views0likes0CommentsSharePoint Online PowerShell Module Gets Modern Authentication
Microsoft has announced that the SharePoint Online PowerShell module will be upgraded from the very old and now obsolete IDCRL protocol to use modern (OAuth) authentication in versions released from March 28, 2025. The update to OAuth should not affect scripts, but it’s always wise to test in case your use of the module is an edge case that Microsoft doesn’t test. https://office365itpros.com/2025/03/14/sharepoint-online-powershell-oauth/182Views0likes0CommentsReporting the Status of Group-Based License Assignments
This article describes how to create a report about group-based licensing assignments and any errors that might have occured. The code uses the Microsoft Graph PowerShell SDK to fetch information about the groups used for licensing assignments, interpret the assignments, find users with assignment errors, and send email to inform administrators about what's been found. https://practical365.com/group-based-licensing-report-email/40Views0likes0CommentsPractical Graph: Nag Users to Upgrade to a Strong Authentication Method
Convincing people to use MFA is one challenge. Convincing them to use a stronger authentication method than SMS is another. This article explains how to use PowerShell to find people still using SMS for MFA and send email to ask them to upgrade their authentication method. https://practical365.com/upgrade-stronger-authentication-method-mfa/44Views0likes0CommentsHow to Retrieve Loop Workspaces Data with PowerShell
A previous attempt to write a script to report all Loop workspaces in a tenant was flawed because it only retrieved the first 200 workspaces. I hadn’t realized that the Get-SPOContainer cmdlet supported an odd form of pagination to retrieve workspace data. In any case, I figured out how to page top find all available workspaces and updated the script. It’s just another example of oddness in the SharePoint Online PowerShell module. https://office365itpros.com/2024/04/08/loop-workspaces-report-ps/812Views1like1Comment