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

Adding support for Set-PnPSearchSettings to be used with vanity domain tenants #2884

Merged
merged 3 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed issue with `Get-PnPListItem` cmdlet not respecting `RowLimit` in the CAML query. [#2804](https://github.com/pnp/powershell/pull/2804)
- Fixed `Connect-PnPOnline -ManagedIdentity -UserAssignedManagedIdentityClientId` not working in Azure Automation Runbooks as it required usage of the object_id parameter instead of the principal_id to get an access token. [#2813](https://github.com/pnp/powershell/pull/2813)
- Fixed `Register-PnPAzureADApp` cmdlet to not change or generate certificate if `-CertificatePath` parameter is already specified. [#2878](https://github.com/pnp/powershell/pull/2878)
- Fixed `Set-PnPSearchSettings` cmdlet not working with vanity domain tenants [#2884](https://github.com/pnp/powershell/pull/2884)

### Contributors

Expand Down
3 changes: 1 addition & 2 deletions src/Commands/Apps/GrantAzureADAppSitePermission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class GrantPnPAzureADAppSitePermission : PnPGraphCmdlet

protected override void ExecuteCmdlet()
{

Guid siteId = Guid.Empty;
if (ParameterSpecified(nameof(Site)))
{
Expand All @@ -48,7 +47,7 @@ protected override void ExecuteCmdlet()
var payload = new
{
roles = Permissions.Select(p => p.ToLower()).ToArray(),
grantedToIdentities = new[] {
grantedToIdentitiesV2 = new[] {
new {
application = new {
id = AppId.ToString(),
Expand Down
9 changes: 4 additions & 5 deletions src/Commands/Search/SetSearchSettings.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Management.Automation;
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Enums;
using Resources = PnP.PowerShell.Commands.Properties.Resources;

Expand Down Expand Up @@ -81,11 +80,11 @@ protected override void ExecuteCmdlet()
}
if (hasSearchPageUrl)
{
ClientContext.Web.SetSiteCollectionSearchCenterUrl(SearchPageUrl);
ClientContext.Web.SetSiteCollectionSearchCenterUrl(SearchPageUrl, Connection.TenantAdminUrl);
}
if (hasSearchPlaceholderText)
{
ClientContext.Site.SetSearchBoxPlaceholderText(SearchBoxPlaceholderText);
ClientContext.Site.SetSearchBoxPlaceholderText(SearchBoxPlaceholderText, Connection.TenantAdminUrl);
}
if (SearchScope.HasValue && ClientContext.Site.RootWeb.SearchScope != SearchScope.Value)
{
Expand All @@ -102,11 +101,11 @@ protected override void ExecuteCmdlet()
}
if (hasSearchPageUrl)
{
ClientContext.Web.SetWebSearchCenterUrl(SearchPageUrl);
ClientContext.Web.SetWebSearchCenterUrl(SearchPageUrl, Connection.TenantAdminUrl);
}
if (hasSearchPlaceholderText)
{
ClientContext.Web.SetSearchBoxPlaceholderText(SearchBoxPlaceholderText);
ClientContext.Web.SetSearchBoxPlaceholderText(SearchBoxPlaceholderText, Connection.TenantAdminUrl);
}
if (SearchScope.HasValue && ClientContext.Web.SearchScope != SearchScope.Value)
{
Expand Down