PowerShell
1943 TopicsMicrosoft Graph PowerShell SDK V2.28 Attempts to Restore Stability
On May 10, 2025, Microsoft released V2.28 of the Microsoft Graph PowerShell SDK in the hope that the new version would fix a bunch of annoying problems that have dogged the SDK for several months. The first few days haven’t revealed any new problems and bug reports are being closed, so the signs are positive. But do test before deploying V2.28 into production. https://office365itpros.com/2025/05/15/microsoft-graph-powershell-sdk-228/2Views0likes0CommentsAdd link to SharePoint Document Library to OneDrive programmatically with PowerShell or PA
Hello, I have a document library on a SharePoint Online Site that needs to be added as a shortcut in each user's OneDrive. Obviously, you can do this individually as the user, but I would like to add this link to each user's OneDrive now, and every time a new user account is created in the future(Will take care of this later). This is required as the leadership for my organization wants users to be able to view the library from their file explorer, but open the file in their browser. (Add Shortcut to OneDrive functionality). The Sync functionality is not acceptable. The "1C" folder here was added by clicking the "Add Shortcut to OneDrive" button on the SPO Document library itself. I would like to achieve the same result, just programmatically for each user. Any advice is greatly appreciated. I am aware of how to create new files in Power Automate and PowerShell, but cannot seem to create the same link as achieved with the "Add Shortcut to OneDrive" button. Thank you in advance for your time, Cam12KViews0likes9CommentsSharePoint Site Storage Limits
Is it possible to change the default storage limit for when a new SharePoint site is created, like how OneDrive storage limit can be set? Changing the SharePoint setting, Site storage limits, to "Manually" allows admins to set it when they create a site. However, I'm wanting to know if it's possible to set a default value of 1TB instead, so it doesn't default to 25TB when a user creates a new Microsoft 365 Group and/or Teams.Solved57Views0likes3CommentsPreservation hold library due to retention labels applied by an adaptive scopes policy
Hi I have an organisation that has recently changed branding and ownership. They have many Tb in SharePoint that needs to be deleted so they are not in breach. Steps taken to remove this content is to remove the property used by the adaptive scope, remove disposition labels from all libraries and then delete from the site information page. In the SharePoint site under site information when selecting delete- a warning comes up that corresponds to items that have a disposition label being present in the PHL. I can not adjust items in the PHL due to its immutable nature. If I go to the admin centre and delete from there then the site does go to the right place in the deleted site list. However, access is retained on the site and if I restore and delete again it comes up with a warning due to the PHL. I am a loss of what to do - sometimes I consider a group law suit against Microsoft because of the stress their tools cause (kick starter anyone?)! I have no confidence that the first delete from the admin centre does anything, I can't remove or change items I'm the PHL and I can't remove the label as only some of the site locations where it is present need to go. Any advice on what to do?9Views0likes0CommentsSharePoint Guest Expiry
We have recently enabled the SharePoint guest expiry setting on our tenant and set this at 30 days. However, we have noticed that this hasn't filtered down to all existing sites which have a custom guest expiration set (e.g. they are still set to expire after 60 days rather than the org level setting of 30 days). I know that we can change this manually on the sites that we are aware of, but we have thousands of sites. Therefore, is there a way of: Getting an export of all SharePoint sites that do not match the org level setting of 30 days guest expiry AND Ensuring that all SharePoint sites are set to match the org level setting of 30 days for the sites that we have external sharing switched on for30Views0likes0CommentsAn Update on Bicep Azure Verified Modules for Platform Landing Zone (ALZ)
But first some history and context As you may of heard in one of our Azure Landing Zone (ALZ) community calls over the past year, across ALZ we have been working hard to refactor both our Terraform and Bicep implementation options to be built upon Azure Verified Modules (AVM). Earlier this year we announced that the work for Terraform, which we started on first, was complete; and you can read more about that in the announcement blog post we posted here. But whilst this work was going on the ALZ Bicep team where already busy planning how they would go about doing the same and rebuilding ALZ Bicep from AVM modules. You can see the original plans and where we also asked for feedback in the GitHub issue (#791) . Enough history, what's the latest? Now to answer the question everyone has and rightly so 😁 Well, it's good news! We have been busy working away on getting a number of the AVM Bicep Resource Modules updated with missing bits and pieces that we need from an ALZ perspective. All fairly minor in most cases but some required some bigger updates than others, and some modules didn't exist at all so we have had to propose, create, and publish those of which we are pretty much done with 👍 We are still working towards an end of Q4 (June/July) target for a preview release of all the modules, accelerator and guidance on how to use the new version of ALZ Bicep, which will be called "Bicep Azure Verified Modules for Platform Landing Zone (ALZ)"; this is to align with Terraform and also to provide clear distinction between ALZ Bicep and the new AVM based version. Please note that the timeline shared above is an ETA and may move Announcing the preview release of `avm/ptn/alz/empty` AVM Pattern Module Before we get to a more complete release of all the required resources and modules to build the entire ALZ architecture with the new Bicep Azure Verified Modules for Platform Landing Zone (ALZ), we wanted to share an early look at the module that will be at the heart of all of your ALZ deployments. That module is called `avm/ptn/alz/empty` and is available in the Public Bicep Registry for you to try out today (currently version `0.1.0`)! Tip: Checkout the "max" test in the tests directory for advanced usage examples! module testMg 'br/public:avm/ptn/alz/empty:0.1.0' = { params: { managementGroupName: 'test-mg' // Other parameters here... } } This module is 1 of 11 modules that will all be based off the same code. The module optionally creates all of the below: The Management Group itself Can also target an existing Management Group Management Group Subscription Associations RBAC Custom Role Definitions RBAC Role Assignments Policy Assignments Custom Policy Definitions Custom Policy Set Definitions (Initiatives) There will also be 1 x Bicep Azure Verified Modules for Platform Landing Zone (ALZ) pattern module for each of the ALZ Architectures Management Groups, plus this empty one for custom and advanced scenarios. A reminder of those Management Groups and the associated modules that will be created for each of them: `avm/ptn/alz/int-root` `avm/ptn/alz/platform` `avm/ptn/alz/platform-management` `avm/ptn/alz/platform-identity` `avm/ptn/alz/platform-connectivity` `avm/ptn/alz/landing-zones` `avm/ptn/alz/landing-zones-corp` `avm/ptn/alz/landing-zones-online` `avm/ptn/alz/decommissioned` `avm/ptn/alz/sandbox` These Management Group aligned pattern modules will create the same resources as above, but will have the latest release of the ALZ Library baked in to each of the modules. Meaning that for the `avm/ptn/alz/int-root` pattern module, you won't have to declare all of the ALZ RBAC Custom Role Definitions, Custom Policy Definitions, Policy Assignments etc. via the input parameters as they'll be hardcoded in the module based off the latest release from the ALZ Library at the point the version of the module was released. This means that to build the ALZ Management Group hierarchy and make all of the default ALZ policy assignments, as documented here, you'd need a bicep file that would look something like this as a starting point: Important: None of these modules exist below today! module intRootMg 'br/public:avm/ptn/alz/int-root:0.1.0' = { params: { managementGroupName: 'int-root-mg' } } module platformMg 'br/public:avm/ptn/alz/platform:0.1.0' = { params: { managementGroupName: 'platform-mg' managementGroupParentId: intRootMg.outputs.managementGroupId } } module platformConnectivityMg 'br/public:avm/ptn/alz/platform-connectivity:0.1.0' = { params: { managementGroupName: 'platform-mg' managementGroupParentId: platformMg.outputs.managementGroupId } } This will make getting the ALZ Architecture out of the box really fast, and also really easy to upgrade and get the latest updates, by just bumping the version number as you desire when you are ready. Coupled with the `avm/ptn/alz/empty` module to add your own additional Policy Definitions and assignments, etc. at the same Management Groups scopes also helps you decouple the constant updates to the ALZ architecture and policies etc. from your own additional requirements. Helping you keep your code cleaner and our modules simple to maintain as we won't have to cater for handling additional custom definitions and assignments alongside the defaults from ALZ that are baked into the modules. Note: We are looking at suggesting that all of these are deployed via Deployment Stacks to help with lifecycle management of resources. e.g. help clean-up resources as well as deploy new ones; think policy assignments and definitions etc. We need to complete a lot more testing on this, but would love your feedback on experiences if you have any using Deployment Stacks to manage these kind of resources today. Open an issue/discussion on the ALZ Bicep GitHub repo 👍 Our asks to you 🫵 Please go try out and test the new `avm/ptn/alz/empty` module and test it out for all the scenarios you can think of relating to Management Groups, RBAC, Policies etc. we want to make sure it's "match fit/ready" before we then build the Management Group aligned modules and bake in the ALZ defaults to them. So please go and put the module through its paces and test it out. Tip: Checkout the "max" test in the tests directory for advanced usage examples! If you find any issues, bugs, feature requests or just have a question on how to use it, please just raise them as GitHub issues here (make sure to select the `avm/ptn/alz/empty` module from the drop down 👍) Thanks in advance for all your efforts and assistance and we look forward to hearing and getting your feedback on the module 👏838Views4likes1CommentObtain 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?41Views0likes2CommentsHow to delete pipeline tags with special characters?
I want to delete specific tags attached to Azure pipeline builds, for example "hello: world". I've come to the conclusion that the ADO REST API endpoint for handling Tag deletions cannot parse special characters in the URL's slug i.e. colons and whitespaces. According to the docs here, the tag should be specified in the URL slug, followed by query string parameters if applicable. I tried the following: 1. If I insert the tag directly into the URL it will look like this: https://dev.azure.com/organisation/project/_apis/build/builds/1234567/tags/hello: world?api-version=7.1 This returns: "Response status code does not indicate success: 400 (Bad Request)." 2. But if I encode my slug using `[System.Web.HttpUtility]::UrlEncode($tag)`, the URL looks like this: https://dev.azure.com/organisation/project/_apis/build/builds/1234567/tags/hello%3a+world?api-version=7.1 This returns "Response status code does not indicate success: 404 (Not Found)." So it seems the encoding might have worked, although it appears to be searching for a tag without decoding the URL first? Does anyone know if there is a way for deleting tags with special characters? I have over 1600+ tags that need to be deleted so manually doing this through the UI would not be a viable option. EDIT: I just realised the documentation has a small note saying: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+) Tried the PATCH method instead of DELETE and still not working. And there's no examples provided in the docs.52Views0likes2CommentsSharePoint List from Excel File
I have several SharePoint lists. Several of the names of the lists need to be changed. Several of the columns in the lists need to be changed. As a test, I've used Power Query to change the names of the columns and saved the file. When I try to create a SharePoint list out of the Power Query edited Excel file the columns are now 'field_1', 'field_2', etc. Is there anyway to use the SharePoint 'Create a list - from Excel' and retain the column names rather than the transition forcing 'field' on all column names?67Views1like1CommentUpdate #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/83Views0likes1Comment