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

New cmdlet for Get-PnPTenantRestrictedSearchAllowedList #3997

Merged
merged 5 commits into from
Jun 18, 2024
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
57 changes: 57 additions & 0 deletions documentation/Get-PnPTenantRestrictedSearchAllowedList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
Module Name: PnP.PowerShell
title: Get-PnPTenantRestrictedSearchAllowedList
schema: 2.0.0
applicable: SharePoint Online
external help file: PnP.PowerShell.dll-Help.xml
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPTenantRestrictedSearchAllowedList.html
---

# Get-PnPTenantRestrictedSearchAllowedList

## SYNOPSIS

**Required Permissions**

* SharePoint: Access to the SharePoint Tenant Administration site and Copilot for M365 license

Retrieves existing list of URLs in the allowed list.

## SYNTAX

```powershell
Get-PnPTenantRestrictedSearchAllowedList [-Connection <PnPConnection>]
```

## DESCRIPTION
This command will return all the existing list of URLs in the allowed list

## EXAMPLES

### EXAMPLE 1

```powershell
Get-PnPTenantRestrictedSearchAllowedList
```

Retrieves existing list of URLs in the allowed list

## PARAMETERS

### -Connection
Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

```yaml
Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

## RELATED LINKS

[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
17 changes: 17 additions & 0 deletions src/Commands/Admin/GetTenantRestrictedSearchAllowedList.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Management.Automation;
using Microsoft.SharePoint.Client;
using PnP.PowerShell.Commands.Base;

namespace PnP.PowerShell.Commands
{
[Cmdlet(VerbsCommon.Get, "PnPTenantRestrictedSearchAllowedList")]
public class GetTenantRestrictedSearchAllowedList : PnPAdminCmdlet
{
protected override void ExecuteCmdlet()
{
var results = Tenant.GetSPORestrictedSearchAllowedList();
AdminContext.ExecuteQueryRetry();
WriteObject(results, true);
}
}
}
Loading