Add Set-PnPMultiGeoCompanyAllowedDataLocation#5368
Conversation
Adds the PnP cmdlet and matching multigeo REST client path to start setting up an allowed SharePoint Online data location. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new SharePoint Online admin cmdlet to initiate setup of a Multi-Geo allowed data location, using the existing MultiGeo REST infrastructure, with matching user-facing messages and documentation.
Changes:
- Introduces
Set-PnPMultiGeoCompanyAllowedDataLocationcmdlet and its request payload model. - Extends
MultiGeoRestApiClientto POST to theAllowedDataLocationsendpoint. - Adds resource strings, cmdlet documentation, cross-links, and a changelog entry.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Commands/Utilities/MultiGeo/MultiGeoRestApiClient.cs | Adds an AllowedDataLocations POST helper and a new client method to submit the request payload. |
| src/Commands/Properties/Resources.resx | Adds localized strings for the confirmation prompt and success messaging (and a version-related message). |
| src/Commands/Properties/Resources.Designer.cs | Regenerates strongly-typed accessors for the newly added resource strings. |
| src/Commands/Model/MultiGeoCompanyAllowedDataLocationEntityData.cs | Adds a JSON-annotated model for the AllowedDataLocations POST body (appId, domain, location). |
| src/Commands/Admin/SetMultiGeoCompanyAllowedDataLocation.cs | Implements the new cmdlet with confirmation messaging and REST client invocation. |
| documentation/Set-PnPMultiGeoCompanyAllowedDataLocation.md | Adds end-user documentation for the new cmdlet. |
| documentation/Get-PnPMultiGeoCompanyAllowedDataLocation.md | Adds a related-link cross-reference to the new Set- cmdlet. |
| CHANGELOG.md | Adds a “Current nightly / Added” entry for the new cmdlet. |
Files not reviewed (1)
- src/Commands/Properties/Resources.Designer.cs: Generated file
| var apiVersion = GetCurrentApiVersion(); | ||
| if (!IsSupportedApiVersion(apiVersion, AllowedDataLocationsApiVersion)) | ||
| { | ||
| throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, CommandResources.CrossGeoInvalidVersion, typeof(MultiGeoRestApiClient).Assembly.GetName().Version)); | ||
| } |
There was a problem hiding this comment.
Leaving this as-is intentionally. Set-SPOMultiGeoCompanyAllowedDataLocation performs its own version check and throws the CrossGeoInvalidVersion client-version message, so this preserves the requested SPO Management Shell error behavior.
| var sharePointHostUrl = string.Format(CultureInfo.InvariantCulture, "https://{0}.sharepoint.com", tenantName); | ||
| var warningMessage = string.Format(CultureInfo.InvariantCulture, Resources.CrossGeoWarningAddAdlMessage, mySiteHostUrl, sharePointHostUrl); | ||
|
|
||
| if (!ShouldProcess(warningMessage, warningMessage, Resources.CrossGeoWarningAddAdlMessageQuery)) |
There was a problem hiding this comment.
Leaving this as-is intentionally. The SPO cmdlet passes the same warning text as both target and action to ShouldProcess, so this preserves the requested SPO Management Shell confirmation/WhatIf behavior.
| ## [Current nightly] | ||
|
|
||
| ### Added | ||
| - Added `Set-PnPMultiGeoCompanyAllowedDataLocation` cmdlet to start setting up a SharePoint Online multi-geo allowed data location. |
There was a problem hiding this comment.
Addressed in the follow-up commit by adding the PR reference to the changelog entry.
Adds output metadata and the changelog PR reference while preserving SPO-compatible REST and confirmation behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add Get, Grant, Set and Revoke cmdlets for EntraID app list permissions Implements ListItems.SelectedOperations.Selected support via the Microsoft Graph beta API. Lists can be addressed by GUID or display name. Permission roles use the correct list-level values (Read, Write, Owner). Display names are enriched via service principal lookup since the Graph beta API omits them on GET responses. Documentation included. * Add Get, Grant, Set and Revoke cmdlets for EntraID app list item permissions Implements ListItems.SelectedOperations.Selected support via the Microsoft Graph beta API. The -ListItem parameter accepts the integer item ID only. Lists can be addressed by GUID or display name. Permission roles use the correct list-level values (Read, Write, Owner). Display names are enriched via service principal lookup since the Graph beta API omits them on GET responses. Documentation included. * Add Get, Grant, Set and Revoke cmdlets for EntraID app file permissions Implements Files.SelectedOperations.Selected support via the Microsoft Graph Drive API. Files can be addressed by path relative to the library root (e.g. Folder/file.docx) or by Graph drive item ID. The drive is resolved through the list's associated drive endpoint. Permission roles use the correct values (Read, Write, Owner). Documentation included. * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Add GitHub workflows for PnP Core and PnP Framework builds (#5314) * Refactor build workflows to pack NuGet packages and create zip files for PnP.Core and PnP.Framework (#5315) * Add GitHub workflows for PnP Core and PnP Framework builds * Refactor build workflows to pack NuGet packages and create zip files for PnP.Core and PnP.Framework --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: gautamdsheth <8832018+gautamdsheth@users.noreply.github.com> * Nightly publish to PowerShell Gallery * Updates pnp framework build workflow (#5316) * Nightly publish to PowerShell Gallery * Updates the pnp framework workflow (#5317) * Sets the cron schedule for the pnp framework build (#5319) * Nightly publish to PowerShell Gallery * Bugfix for connection * Updates PnP.Core build workflow (#5321) * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Update GitHub Actions to use latest versions of actions and dependencies (#5323) * Nightly publish to PowerShell Gallery * Update documentation build workflows and Dockerfiles to use latest versions of DocFX and .NET (#5324) * Update documentation build workflows and Dockerfiles to use latest versions of DocFX and .NET * Add documentation for building the site locally and update .gitignore * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Add properties * Update AllowFileArchiveOnNewSitesByDefault * Update with changes after merge * Add additional parameters to site * Update with properties * Nightly publish to PowerShell Gallery * update to add props * Update CHANGELOG with recent changes and contributors Added new properties to Set-pnptenant and Get-pnptenant cmdlets and updated contributors section. * Add WhoCanShareAllowListInTenantByPrincipalIdentity support (#5322) Introduce new parameter to Set-Tenant cmdlet for specifying principal identities allowed to share content at the tenant level. Update cmdlet logic to handle assignment and clearing of this list. Add corresponding property to SPOTenant model with documentation. Co-authored-by: Vasco Azevedo <vasco.azevedo@bindtuning.com> Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com> * updated documentation (#5328) Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com> * Enhance documentation and add support for dark mode in the theme selector (#5332) * Update documentation and build scripts for improved clarity and functionality * Enhance documentation and add support for dark mode in the theme selector * Update documentation * Enhance documentation with additional descriptions and links for articles, cmdlets, and installation processes; add new llms.txt file for quick reference. (#5334) * Enhance documentation and functionality to support Linux Secret Service for managing App Ids across platforms (#5335) * Enhance documentation and functionality to support Linux Secret Service for managing App Ids across platforms * Enhance documentation and error handling for Linux Secret Service support in Get-PnPManagedAppId, Remove-PnPManagedAppId, and Set-PnPManagedAppId cmdlets * Nightly publish to PowerShell Gallery * Update CHANGELOG with new cmdlet properties Added new properties to Set-pnptenant, Get-pnptenant, set-pnpsite, and set-pnptenantsite cmdlets. * Add Get-PnPMultiGeoCompanyAllowedDataLocation cmdlet and related model for allowed data locations (#5336) * Add Get-PnPMultiGeoCompanyAllowedDataLocation cmdlet and related model for allowed data locations * Update CHANGELOG to include Get-PnPMultiGeoCompanyAllowedDataLocation cmdlet * Add Get-PnPGeoMoveCrossCompatibilityStatus cmdlet and related models for geo move compatibility checks (#5337) * Add Get-PnPUserAndContentMoveState cmdlet and related model for user and content move state retrieval (#5338) * Add favicon and implement markdown copy functionality with UI enhancements (#5339) * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Fixes to multi-geo cmdlets (#5343) * Fix markdown and related issues (#5344) * Fix markdown and related issues * Fix docs script * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Added mention of 3 PRs from fabianhutzli * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Add conditional execution for workflows based on repository owner (#5345) * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Update documentation and error handling for Viva Connections Dashboard ACE commands to reflect support for Team and Communication sites (#5351) * Update documentation and error handling for Viva Connections Dashboard ACE commands to reflect support for Team and Communication sites * Update documentation and error messages for Viva Connections Dashboard ACE commands to specify SharePoint Team site requirement * Enhance error handling in RemoveServicePrincipalRoleAssignment methods and update return types to indicate success or failure (#5353) * Enhance error handling in RemoveServicePrincipalRoleAssignment methods and update return types to indicate success or failure * Update permissions and documentation for Add-PnPTeamsChannel and ServicePrincipalUtility methods * Improve error messaging for missing app role assignments in RemoveEntraIDServicePrincipalAssignedAppRole cmdlet * Refactor ClientContext execution flow in list item commands to ensure proper loading and updating of items (#5354) * Add Start-PnPUserAndContentMove cmdlet for multi-geo user and content migration (#5355) * Add Start-PnPUserAndContentMove cmdlet for multi-geo user and content migration * Update CHANGELOG.md to include pull request reference for Start-PnPUserAndContentMove cmdlet * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Added Microsoft ToDo cmdlets * Updated cmdlet numer * Added reference to PR 5356 on ToDo cmdlets Added cmdlets for managing Microsoft To Do tasks and updated tenant properties. * Fixing changelog instruction * Delete src/Commands/CHANGELOG.md as it was in the wrong place * Nightly publish to PowerShell Gallery * Update CHANGELOG with new cmdlets and fixes Added multiple cmdlets for Microsoft To Do tasks and improved existing cmdlets with new properties and fixes. * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Update Microsoft.Identity.Client.Extensions.Msal version Updated Microsoft.Identity.Client.Extensions.Msal package version to 4.85.2. * Update AzureEnvironment accepted values in documentation for cloud support (#5361) * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Add Get-PnPUnifiedGroupMoveState cmdlet (#5362) * Add unified group move state cmdlet * Address unified group move state review * Add Stop-PnPUserAndContentMove cmdlet (#5363) * Add stop user and content move cmdlet Add Stop-PnPUserAndContentMove using the existing multigeo REST client and SPO-compatible cancel endpoint, output, and parameter shape. * Address user move stop review feedback Reuse the existing UPN move job path when building the cancel endpoint and add the PR reference to the changelog entry. * Add Start-PnPUnifiedGroupMove cmdlet (#5364) * Add unified group move cmdlet * Address unified group move review feedback * Add Get-PnPSiteContentMoveState (#5365) * Add site content move state cmdlet Adds Get-PnPSiteContentMoveState using the existing multi-geo REST client, SPO-compatible site move endpoints, site move output formatting, documentation, and changelog coverage. * Add PR link to changelog entry * Add Stop-PnPSiteContentMove cmdlet (#5366) * Add Start-PnPSiteContentMove cmdlet (#5367) * Add site content move cmdlet Implement Start-PnPSiteContentMove using the existing MultiGeo REST client and site move response formatting. # Conflicts: # src/Commands/Utilities/MultiGeo/UserAndContentMoveStateFormatter.cs * Fix site move rebase conflict Remove stale generic site move formatting after rebasing onto the dedicated SiteMoveJob formatter from dev. * Nightly publish to PowerShell Gallery * Add Set-PnPMultiGeoCompanyAllowedDataLocation (#5368) * Add Set-PnPMultiGeoCompanyAllowedDataLocation Adds the PnP cmdlet and matching multigeo REST client path to start setting up an allowed SharePoint Online data location. * Address Set-PnPMultiGeo review feedback Adds output metadata and the changelog PR reference while preserving SPO-compatible REST and confirmation behavior. * Add Set-PnPMultiGeoExperience cmdlet (#5369) * Add Set-PnPMultiGeoExperience cmdlet * Address Set-PnPMultiGeoExperience review comments * Add Get-PnPGeoStorageQuota cmdlet (#5371) * Add Set-PnPGeoStorageQuota cmdlet (#5370) * Fix cmdlet references in documentation and resources for multi-geo experience * Add Get-PnPMultiGeoExperience cmdlet (#5372) * Add Get-PnPMultiGeoExperience cmdlet * Add PR link to multigeo changelog entry * Enhance JSON serialization options to allow reading numbers from strings * Add support for minimum API version checks and enhance move state output formatting * Enhance site move job creation with confirmation handling for marketplace apps and workflows * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Add Get-PnPGeoAdministrator cmdlet (#5378) * Add Get-PnPGeoAdministrator cmdlet * Link Get-PnPGeoAdministrator changelog entry * Add Remove-PnPGeoAdministrator cmdlet (#5380) * Add Remove-PnPGeoAdministrator cmdlet Add a PnP cmdlet for removing SharePoint Online geo administrators through the existing MultiGeo REST client. Match the SPO management shell request shape for user, group, and object ID removal. * Use parameter set dispatch for geo admin removal Update Remove-PnPGeoAdministrator to dispatch by ParameterSetName and remove the generic empty GUID fallback. * Add PnP geo administrator cmdlet (#5381) * Add Remove-PnPMultiGeoCompanyAllowedDataLocation (#5379) * Add validation for ObjectId in AddGeoAdministrator and RemoveGeoAdministrator cmdlets; ensure Geo Administrator support in MultiGeoRestApiClient * Nightly publish to PowerShell Gallery * Add support for applying built-in Microsoft site designs (store 1) (#5358) The existing Get-PnPSiteDesign and Invoke-PnPSiteDesign cmdlets used CSOM (Tenant.GetSiteDesigns / Tenant.ApplySiteDesign) which only works for tenant-registered custom designs (store 0). Microsoft's built-in site designs such as Event, Department and Human Resources live in the SharePoint site template store (store 1) and require the SiteScriptUtility REST API with a store parameter — there was no way to reach them from PnP PowerShell. - Add Get-PnPSiteDesign -BuiltIn switch: calls SiteScriptUtility.GetSiteDesigns with store 1 and returns BuiltInSiteDesign objects (Id, Title, Template enum) - Add Invoke-PnPSiteDesign -Template <BuiltInSiteTemplates>: resolves the GUID from the existing BuiltInSiteTemplates enum mapping and calls SiteScriptUtility.ApplySiteDesign with store 1 - Add BuiltInSiteDesign model class for deserialising the REST response - Add GetBuiltInSiteDesigns and ApplyBuiltInSiteDesign utility methods to SiteTemplates.cs so the REST logic is centralised - Fix missing DefaultParameterSetName on Get-PnPSiteDesign to prevent ambiguous parameter set error when called without arguments - Update documentation for both cmdlets with new syntax, parameter descriptions and usage examples Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com> * Update CHANGELOG with new cmdlet features and fixes Updated CHANGELOG with new cmdlet properties and fixes. * Add Get-PnPUserOneDriveLocation cmdlet (#5382) * Add user OneDrive location cmdlet * Address OneDrive location review feedback * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Nightly publish to PowerShell Gallery * Cross-reference minimal-permissions page migration guide (#5383) * Nightly publish to PowerShell Gallery * Update PnP.PowerShell.csproj * Update Build-Release.ps1 * Major release to PowerShell Gallery * Update CHANGELOG.md --------- Co-authored-by: Fabian Hutzli <fabian.hutzli@mobi.ch> Co-authored-by: erwinvanhunen <erwinvanhunen@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: gautamdsheth <8832018+gautamdsheth@users.noreply.github.com> Co-authored-by: Adam Wójcik <58668583+Adam-it@users.noreply.github.com> Co-authored-by: Koen Zomers <koen@zomers.eu> Co-authored-by: Reshmee Auckloo <reshmee011@gmail.com> Co-authored-by: Vasco Azevedo <vascoazevedo70@gmail.com> Co-authored-by: Vasco Azevedo <vasco.azevedo@bindtuning.com> Co-authored-by: Tetronic <49990832+Tetronic@users.noreply.github.com> Co-authored-by: gautamdsheth <gautamdsheth@users.noreply.github.com> Co-authored-by: Fabian Hutzli <136681117+fabianhutzli@users.noreply.github.com> Co-authored-by: Rick Zhu <zhenhzhu@126.com>
Type
Related Issues?
N/A
What is in this Pull Request ?
Adds
Set-PnPMultiGeoCompanyAllowedDataLocationto start setting up SharePoint Online multi-geo allowed data locations with the same request shape and user-facing output as SPO Management Shell.The cmdlet reuses the existing multigeo REST client, posts to
AllowedDataLocationswithappId,domain, andlocation, and adds matching confirmation/success messages, documentation, and a changelog entry.Guidance
N/A