Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3520 #3533

Merged
merged 8 commits into from Oct 29, 2023
Merged

Fix #3520 #3533

merged 8 commits into from Oct 29, 2023

Conversation

koskila
Copy link
Contributor

@koskila koskila commented Oct 25, 2023

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

Fixes #3520.

What is in this Pull Request ?

Adds a new override switch for admin url validation - which can thus be disabled to support vanity domains and other deviating address schemes (works in conjunction with -TenantAdminUrl)

@gautamdsheth
Copy link
Collaborator

I guess we don't need all this, simply this check should be ok

var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(AdminContext.Url);

We store the tenantAdminUrl in the connection object, we just need to reuse it.
Can you change the code for this ?

@koskila
Copy link
Contributor Author

koskila commented Oct 26, 2023

@gautamdsheth I guess that would be pretty much the same, since the admin site URL in the AdminContext is already constructed based on the supplied admin url.

... although, to be fair, we could just use AdminContext.Url as it is and completely ignore the call to GetTenantAdministrationUrl in all cases? It's already once validated (or guessed), having a second layer of validation might not really make sense?

@gautamdsheth
Copy link
Collaborator

@koskila - you are right,AdminContext.Url will have this , have changed the code

@gautamdsheth gautamdsheth merged commit 86ae14c into pnp:dev Oct 29, 2023
1 check failed
gautamdsheth added a commit that referenced this pull request Dec 12, 2023
* Update index.md

* Update Build-Site.ps1

* Update Build-Site.ps1

* Update Build-Site.ps1

* Update Build-Site.ps1

* Update Build-Site.ps1

* Update Build-Site.ps1

* Update index.md

* Update Build-Site.ps1

* Update Build-Site.ps1

* Update index.md

* Fixing documentation build warnings

* Fixing documentation build warnings

* Fixing documentation build warnings

* Fixing documentation build warning

* Added changed entry for PR 3455

* Adding required permissions

* Adding newline

* Adding alias template file

* Removing deprecation notice

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Added silent authentication

* Feature: added output types to page cmdlets

* Feature: added output types for Principals cmdlets

* Update authentication.md added documentation for MFA enabled

* Feature: add support for RAC in site cmdlets

* Feature: added output types for site scripts and designs

* Nightly publish to PowerShell Gallery

* Fix #3447 : issue with page scheduling feature.
Refactor some code

* [FileVersion] Get-PnPSite change for VersionPolicy

* Nightly publish to PowerShell Gallery

* Add new command get-pnpretentionlabel (#3459)

* Add new command get-pnpretentionlabel

* Added the Identity parameter and graph permissions

* Added    [RequiredMinimalApiPermissions("RecordsManagement.Read.All")] attribute

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Update CHANGELOG.md

* Update Set-PnPSearchExternalItem.md

Updating sample text from Dutch to English

* Resolve comment

* Nightly publish to PowerShell Gallery

* Feature #1346 - Improved Remove-PnPFlow cmdlet to throw error and add verbose logging

* Update authentication.md added images as suggested by the reviewer

Update authentication.md added images as suggested by the reviewer

* Nightly publish to PowerShell Gallery

* Created a new folder for authentication images

* Added screenshots for authentication article

* Update authentication.md added images references as suggested by the reviewer

* Nightly publish to PowerShell Gallery

* Adding PR reference

* Added PR reference

* Resolve comment

* Added PR reference

* Nightly publish to PowerShell Gallery

* Add a new command Get-PnPSiteVersionPolicy, revert the change in Get-PnPSite

* Added entry for PnP Core PR 1290

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Feature: add GCC support for some cmdlets

* Nightly publish to PowerShell Gallery

* Clarified the error message when running a PnPAdminCmdlet so it also includes a hint towards checking for PIM activation as many customers are using that nowadays and forget to enable it (#3492)

* Fix retrieving error detail in Get-UPABulkImportStatus (#3494)

* Fix retrieving error detail in Get-UPABulkImportStatus

* Handle exceptions when setting the error message

* Update CHANGELOG.md

* Additional cmdlet support for GCC

* Added changelog entry

* Fix  Bug 3495

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Update Set-PnPTenantSite.md (#3501)

Added -DisableSharingForNonOwners to documentation

* Update CHANGELOG.md

* Nightly publish to PowerShell Gallery

* Fixes #3504 Add message "Team Not found" if team is not returned  (#3502)

* Throw Error If Team Not found

* Update GetTeamsTeam.cs

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Update CHANGELOG.md

* 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 an optional Retry-loop around executing the search query

* Feature #2683 : added support for containers (#3497)

* Feature #2683 : added support for containers

* Improved container image

* Added gitlens

* Improve image

* Improve container process

---------

Co-authored-by: Gautam Sheth <gautam.sheth@staffbase.com>

* Allow to specify additional properties to include in Get-PnPSiteCollectionAdmin (#3521)

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Update CHANGELOG.md

* Changed GetContentType to inherit from PnPWebRetrievalsCmdlet (#3518)

* Changed GetContentType to inherit from PnPWebRetrievalsCmdlet

* Added PR reference

* Adding extra spacing for readability and consistency

* Updated documentation to include the -Includes parameter

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Antti/update submitsearchquery docs (#3527)

* Update documentation for Submit-PnPSearchQuery

* Changes sentence ending to be consistent 😅

* Document LCIDs used by -Culture switch

* Update Submit-PnPSearchQuery.md

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Update CHANGELOG.md

* Fix #3503 : fix return type for field (#3510)

Co-authored-by: Gautam Sheth <gautam.sheth@staffbase.com>

* Update CHANGELOG.md

* Remove the logic to look into the exception specifics with Reflection and just simply always retry

* Update wait time to match documentation.

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Fix #3404 - Update main.css

* Add AllowExternalSenders, AutoSubscribeNewMembers and MailNickname

* Add property mailNickname

* Add mailnickname

* Update documentation

* correct case of mailnickname

* 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

* Fixes #3163 (#3530)

* Fixes the bug where all -UseWebLogin auth requests go to the root site collection and implements an override for site-relative auth URI

* Remove unused using

* Update ConnectOnline.cs

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Fix #3520 (#3533)

* Add a switch to override "validating" tenant admin url

* How did that get there? 😶

* Revert "How did that get there? 😶"

This reverts commit 00f899f.

* Revert "Add a switch to override "validating" tenant admin url"

This reverts commit 802a519.

* Implement @gautamdsheth's feedback :)

* Update RenameTenantSite.cs

* Update RenameTenantSite.cs

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Update CHANGELOG.md

* Nightly publish to PowerShell Gallery

* Fixed namespaces

* 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

* Fixed typos Microsft

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Adding contributors entry

* Adding changelog entry

* Changing exceptions not to be swallowed but shown in verbose and the exception to be thrown if it still happens on the last attempt

* Added changelog entry

* Adding modern list template Ids

* Adding notice with the -Delta parameter

Adding notice with the -Delta parameter that using it in combination with -Select and -Filter has limitations

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Added `-BusinessConnectivityServiceDisabled` to `Set-PnPTenant` (#3562)

* Added BusinessConnectivityServiceDisabled to Set-PnPTenant

* Added PR reference

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Adding request file links properties to site and tenant output (#3557)

* Cleanup of the file. Removing separate private properties and replacing by get/set properties to simplify.

* Adding CoreRequestFilesLinkEnabled, CoreRequestFilesLinkExpirationInDays, OneDriveRequestFilesLinkEnabled and OneDriveRequestFilesLinkExpirationInDays

* Adding RequestFilesLinkEnabled and RequestFilesLinkExpirationInDays

* Adding changelog entry

* Added BusinessConnectivityServiceDisabled

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Added Information Barriers information to the output of `Get-PnPTenantSite` (#3556)

* Added Information Barriers information to the output of `Get-PnPTenantSite`

* Added PR reference

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Adding possibility to set SAN when using `New-PnPAzureCertificate` (#3555)

* Adding possibility to set the Subject Alternative Names on the self signed certificate

* Adding changelog entry

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Renaming Get-PnPWebhooksubscriptions to singular notation to align with the other cmdlets. Added an alias for backwards compatibility. (#3551)

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Rename and bugfixes in `Get-PnPFolder`, `Get-PnPFolderFolder` and `Get-PnPFolderFile` cmdlets (#3421)

* Bugfixes in Get-PnPFolder

* Renaming Get-PnPFolderFile and Get-PnPFolderFolder as discussed

* Updating documentation

* Updated changelog to new cmdlet names

* Added example on combinging Get-PnPFolder with Get-PnPFileInFolder

* Updated example 7 to use the ExcludeSystemFolders parameter

* Bugfix

* Changing recursive parameter to recurse to align with get-pnpfileinfolder and get-childitem

* Applying feedback to keep the cmdlet backwards compatible

* Bugfix

* Adding ignore for obsolete warning

* Changing code to be backwards compatible

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Adding `-Detailed` option to `Get-PnPTenantDeletedSite` (#3550)

* Adding -Detailed option to Get-PnPTenantDeletedSite to optionally fetch more information on the deleted sites

* Adding changelog entry

* Adding PR reference

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Changes as per review comments

* [FileVersion] Add command to get progress for set version policy

* Feature #1644 : Add support for batch requests in
Invoke-PnPSPRestMethod

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Adding changelog entry

* Added changelog entry

* Nightly publish to PowerShell Gallery

* Fixed fetching user with apostrophe in UPN

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Adding documentation on -BusinessConnectivityServiceDisabled

* Changes to move this fix to a lower level so it also fixes it for 2 other cmdlets

* Adding changelog entry

* Updating notice on PnP PowerShell support for Azure Functions

* Add files via upload

* Add files via upload

* Updated steps on adding a custom certificate to reflect the updated webUI

* Add files via upload

* Add files via upload

* Nightly publish to PowerShell Gallery

* Adding .NET 8

* Update buildpr.yml

Adding .NET 8 build for Core SDK

* Changing to Core SDK 8.0 reference

* Adding missing quotes

* Check fix with slash

* Fix path for .NET 8

* Update PnP.PowerShell.csproj

* Update PnP.PowerShell.csproj

* Update buildpr.yml

* Implementation

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Update documentation

* Added changelog entry

* Nightly publish to PowerShell Gallery

* fix for bug 3589

* Nightly publish to PowerShell Gallery

* Cleanup

* Added changelog entry

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Update builddocsite.yml

* Fix docs site navigation

* Fix docs site nav again

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Typo fix

* Destination path resolved wrongly on MacOs

* 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 Add-PnPFile.md

Updated examples 4, 5 and 6. 

The date examples used were 1/1/2016

Where mm/dd/yyyy is required. Examples using 12/28/2026 are therefore clearer.

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* New cmdlet remove-pnpmicrosoft365GroupPhoto (#3607)

* New cmdlet remove-pnpmicrosoft365GroupPhoto

* Update SetTeamsTeamPicture.cs

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Update CHANGELOG.md

* Adding to contributors

* Adding extra notice to parameters part

* new cmdlet get-pnpcontainer

* Nightly publish to PowerShell Gallery

* Added `Manage` and `FullControl` to `Grant-PnPAzureADAppSitePermission` (#3617)

* Added Manage and FullControl to Grant-PnPAzureADAppSitePermission

* Adding PR reference

---------

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Cleanup

* 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 PnP.PowerShell.Tests.csproj

* Update PnP.PowerShell.csproj

* Create PnP.PowerShell.Suggestions.2.3.0.json

---------

Co-authored-by: erwinvanhunen <erwinvanhunen@users.noreply.github.com>
Co-authored-by: Kshitiz Kalra <kshitizkalraz@gmail.com>
Co-authored-by: Gautam Sheth <gautam.sheth@staffbase.com>
Co-authored-by: Jenny Wu <jennywu@microsoft.com>
Co-authored-by: Reshmee Auckloo <reshmee011@gmail.com>
Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
Co-authored-by: Dave Paylor <davepaylor@hotmail.com>
Co-authored-by: Antti K. Koskela <posti@koskila.net>
Co-authored-by: Erwin van Hunen <erwin.van.hunen@outlook.com>
Co-authored-by: Christian Veenhuis <124370897+ChVeen@users.noreply.github.com>
Co-authored-by: jennywu <jennywu@microsoft.com_odspmdb>
Co-authored-by: Daniel Cecil <danielcecil@hotmail.com>
Co-authored-by: wilecoyotegenius <wile.genius@gmail.com>
Co-authored-by: Pieter Veenstra <pieter.veenstra@live.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]Rename-PnPTenantSite are not working as expected in Tenants with vanity url.
2 participants