Skip to content

Commit

Permalink
Merge pull request #4713 from KoenZomers/EnterpriseAppInsightsReports
Browse files Browse the repository at this point in the history
Added `Get-PnPEnterpriseAppInsightsReport` and `Start-PnPEnterpriseAppInsightsReport`
  • Loading branch information
KoenZomers authored Jan 30, 2025
2 parents 8bca08f + 1336da5 commit fef7802
Show file tree
Hide file tree
Showing 330 changed files with 1,013 additions and 647 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `Get-PnPTenantPronounsSetting` and `Set-PnPTenantPronounsSetting` cmdlets to manage the availability of using pronouns in the organization [#4660](https://github.com/pnp/powershell/pull/4660)
- Added `HidePeopleWhoHaveListsOpen` parameter to `Set-PnPSite` cmdlet to hide people who simultaneously have lists open [#4699](https://github.com/pnp/powershell/pull/4699)
- Added `-WhoCanShareAllowListInTenant`, `-LegacyBrowserAuthProtocolsEnabled`, `-EnableDiscoverableByOrganizationForVideos`, `-RestrictedAccessControlforSitesErrorHelpLink`, `-Workflow2010Disabled`, `-AllowSharingOutsideRestrictedAccessControlGroups`, `-HideSyncButtonOnDocLib`, `-HideSyncButtonOnODB`, `-StreamLaunchConfig`, `-EnableMediaReactions`, `-ContentSecurityPolicyEnforcement` and `-DisableSpacesActivation` to `Set-PnPTenant` [#4681](https://github.com/pnp/powershell/pull/4681)
- Added `Start-PnPEnterpriseAppInsightsReport` and `Get-PnPEnterpriseAppInsightsReport` which allow working with App Insights repors [#4713](https://github.com/pnp/powershell/pull/4713)

### Changed

Expand Down
102 changes: 102 additions & 0 deletions documentation/Get-PnPEnterpriseAppInsightsReport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPEnterpriseAppInsightsReport.html
external help file: PnP.PowerShell.dll-Help.xml
title: Get-PnPEnterpriseAppInsightsReport
---

# Get-PnPEnterpriseAppInsightsReport

## SYNOPSIS

**Required Permissions**

* Microsoft SharePoint API: Sites.ReadWrite.All

Checks for the status of the generation of the App Insights reports and allows downloading them when they're done.

## SYNTAX

### Details on all available reports

```powershell
Get-PnPEnterpriseAppInsightsReport
```

### Details on a specific report

```powershell
Get-PnPEnterpriseAppInsightsReport -ReportId <string>
```

### Download a report

```powershell
Get-PnPEnterpriseAppInsightsReport -ReportId <string> -Action Download
```

## DESCRIPTION

This cmdlet allows checking for the status of generated App Insights reports. Only one report can exist for every supported timespan `day, 7 days, 14 days, or 28 days. New requests for reports can be initiated using [Start-PnPEnterpriseAppInsightsReport](Get-PnPEnterpriseAppInsightsReport.md) and will overwrite any existing reports thay may exist.

This cmdlet also allows for downloading of the report data when the report is ready.

## EXAMPLES

### EXAMPLE 1
```powershell
Get-PnPEnterpriseAppInsightsReport
```

Will return all reports that have been generated or are still being generated.

### EXAMPLE 2
```powershell
Get-PnPEnterpriseAppInsightsReport -ReportId bed8845f-72ba-43ec-b1f3-844ff6a64f28
```

Will return details on the report with the specified ID.

### EXAMPLE 3
```powershell
Get-PnPEnterpriseAppInsightsReport -ReportId bed8845f-72ba-43ec-b1f3-844ff6a64f28 -Action Download
```

Will return the contents of the report with the specified ID as text.

## PARAMETERS

### -ReportId
The amount of days to cover in the report. Valid values are 1, 7, 14, and 28. Default is 1.

```yaml
Type: string
Parameter Sets: Details on a specific report, Download a report

Required: True
Position: Named
Default value: 1
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -Action
When provided with the value `Download`, the cmdlet will return the contents of the report as text.

```yaml
Type: short
Parameter Sets: Download a report
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

## RELATED LINKS

[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
[Generate App Insights Reports](https://learn.microsoft.com/sharepoint/app-insights)
65 changes: 65 additions & 0 deletions documentation/Start-PnPEnterpriseAppInsightsReport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Start-PnPEnterpriseAppInsightsReport.html
external help file: PnP.PowerShell.dll-Help.xml
title: Start-PnPEnterpriseAppInsightsReport
---

# Start-PnPEnterpriseAppInsightsReport

## SYNOPSIS

**Required Permissions**

* Microsoft SharePoint API: Sites.ReadWrite.All

Generates a report for the App Insights data.

## SYNTAX

```powershell
Start-PnPEnterpriseAppInsightsReport [-ReportPeriodInDays <1, 7, 14, 28>]
```

## DESCRIPTION

This cmdlet will start the generation of a new App Insights report. It can generate a report over the past day (default), 7 days, 14 days, or 28 days. It will overwrite any existing report for the same period. The report will be generated in the background. Use [Get-PnPEnterpriseAppInsightsReport](Get-PnPEnterpriseAppInsightsReport.md) to check the status of the report.

## EXAMPLES

### EXAMPLE 1
```powershell
Start-PnPEnterpriseAppInsightsReport
```

A report will be generated which covers the past day.

### EXAMPLE 2
```powershell
Start-PnPEnterpriseAppInsightsReport 28
```

A report will be generated which covers the past 28 days.

## PARAMETERS

### -ReportPeriodInDays
The amount of days to cover in the report. Valid values are 1, 7, 14, and 28. Default is 1.

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

Required: True
Position: Named
Default value: 1
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
[Generate App Insights Reports](https://learn.microsoft.com/sharepoint/app-insights)
2 changes: 1 addition & 1 deletion src/Commands/Admin/AddHomeSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Add, "PnPHomeSite")]
public class AddHomeSite : PnPAdminCmdlet
public class AddHomeSite : PnPSharePointOnlineAdminCmdlet
{
[Alias("Url")]
[Parameter(Mandatory = true)]
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/AddHubSiteAssociation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Add, "PnPHubSiteAssociation")]
public class AddHubSiteAssociation : PnPAdminCmdlet
public class AddHubSiteAssociation : PnPSharePointOnlineAdminCmdlet
{
[Parameter(Mandatory = true)]
public SitePipeBind Site;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/AddHubToHubAssociation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Add, "PnPHubToHubAssociation")]
public class AddHubToHubAssociation : PnPAdminCmdlet
public class AddHubToHubAssociation : PnPSharePointOnlineAdminCmdlet
{
const string ParamSet_ById = "By Id";
const string ParamSet_ByUrl = "By Url";
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/AddMicrosoft365GroupToSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Add, "PnPMicrosoft365GroupToSite")]
public class AddMicrosoft365GroupToSite: PnPAdminCmdlet
public class AddMicrosoft365GroupToSite: PnPSharePointOnlineAdminCmdlet
{
[Parameter(Mandatory = false)]
public string Url;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/AddOrgAssetsLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Add, "PnPOrgAssetsLibrary")]
public class AddOrgAssetsLibrary : PnPAdminCmdlet
public class AddOrgAssetsLibrary : PnPSharePointOnlineAdminCmdlet
{
[Parameter(Mandatory = true)]
public string LibraryUrl;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/AddOrgNewsSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Add, "PnPOrgNewsSite")]
public class AddOrgNewsSite : PnPAdminCmdlet
public class AddOrgNewsSite : PnPSharePointOnlineAdminCmdlet
{
[Parameter(Mandatory = true)]
public SitePipeBind OrgNewsSiteUrl;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/AddSiteCollectionAppCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Add, "PnPSiteCollectionAppCatalog")]
public class AddSiteCollectionAppCatalog : PnPAdminCmdlet
public class AddSiteCollectionAppCatalog : PnPSharePointOnlineAdminCmdlet
{
[Parameter(Mandatory = false, ValueFromPipeline = false, Position = 0)]
public SitePipeBind Site;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/AddTenantCdnOrigin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Add, "PnPTenantCdnOrigin")]
public class AddTenantCdnOrigin : PnPAdminCmdlet
public class AddTenantCdnOrigin : PnPSharePointOnlineAdminCmdlet
{
[Parameter(Mandatory = true)]
public string OriginUrl;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/AddTenantRestrictedSearchAllowedList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Add, "PnPTenantRestrictedSearchAllowedList", DefaultParameterSetName = ParameterSet_SiteList)]
public class AddTenantRestrictedSearchAllowedList : PnPAdminCmdlet
public class AddTenantRestrictedSearchAllowedList : PnPSharePointOnlineAdminCmdlet
{
private const string ParameterSet_SiteList = "SiteList";
private const string ParameterSet_File = "File";
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/AddTenantTheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Add, "PnPTenantTheme")]
public class AddTenantTheme : PnPAdminCmdlet
public class AddTenantTheme : PnPSharePointOnlineAdminCmdlet
{
[Parameter(Mandatory = true, ValueFromPipeline = true)]
public ThemePipeBind Identity;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/ClearTenantAppCatalogUrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace PnP.PowerShell.Commands
{
[Cmdlet(VerbsCommon.Clear, "PnPTenantAppCatalogUrl")]
public class ClearTenantAppCatalogUrl : PnPAdminCmdlet
public class ClearTenantAppCatalogUrl : PnPSharePointOnlineAdminCmdlet
{
protected override void ExecuteCmdlet()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetBrowserIdleSignOut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPBrowserIdleSignout")]
public class GetBrowserIdleSignout : PnPAdminCmdlet
public class GetBrowserIdleSignout : PnPSharePointOnlineAdminCmdlet
{
protected override void ExecuteCmdlet()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetBuiltInDesignPackageVisibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPBuiltInDesignPackageVisibility")]
public class GetBuiltInDesignPackageVisibility : PnPAdminCmdlet
public class GetBuiltInDesignPackageVisibility : PnPSharePointOnlineAdminCmdlet
{
[Parameter(Mandatory = false)]
public DesignPackageType DesignPackage;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPContainer")]
[OutputType(typeof(SPContainerProperties))]
public class GetContainer : PnPAdminCmdlet
public class GetContainer : PnPSharePointOnlineAdminCmdlet
{
[Parameter(Mandatory = false, Position = 0, ValueFromPipeline = true)]
public ContainerPipeBind Identity { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetContainerType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPContainerType")]

public class PnPContainerType : PnPAdminCmdlet
public class PnPContainerType : PnPSharePointOnlineAdminCmdlet
{
protected override void ExecuteCmdlet()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetContainerTypeConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPContainerTypeConfiguration")]
public class GetContainerTypeConfiguration : PnPAdminCmdlet
public class GetContainerTypeConfiguration : PnPSharePointOnlineAdminCmdlet
{
[Parameter(Mandatory = true)]
public Guid Identity;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetDeletedContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPDeletedContainer")]
public class PnPDeletedContainer : PnPAdminCmdlet
public class PnPDeletedContainer : PnPSharePointOnlineAdminCmdlet
{
protected override void ExecuteCmdlet()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetDisableSpacesActivation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace PnP.PowerShell.Commands
{
[Cmdlet(VerbsCommon.Get, "PnPDisableSpacesActivation")]
public class GetDisableSpacesActivation : PnPAdminCmdlet
public class GetDisableSpacesActivation : PnPSharePointOnlineAdminCmdlet
{
protected override void ExecuteCmdlet()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetExternalUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPExternalUser")]
public class GetExternalUser : PnPAdminCmdlet
public class GetExternalUser : PnPSharePointOnlineAdminCmdlet
{
[Parameter(Mandatory = false)]
public int Position;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetHideDefaultThemes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPHideDefaultThemes")]
public class GetHideDefaultThemes : PnPAdminCmdlet
public class GetHideDefaultThemes : PnPSharePointOnlineAdminCmdlet
{
protected override void ExecuteCmdlet()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetHomeSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPHomeSite", DefaultParameterSetName = ParameterSet_Basic)]
public class GetHomeSite : PnPAdminCmdlet
public class GetHomeSite : PnPSharePointOnlineAdminCmdlet
{
private const string ParameterSet_Detailed = "Detailed";
private const string ParameterSet_Basic = "Basic";
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetHubSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPHubSite")]
public class GetHubSite : PnPAdminCmdlet
public class GetHubSite : PnPSharePointOnlineAdminCmdlet
{
[Parameter(Position = 0, ValueFromPipeline = true)]
public HubSitePipeBind Identity { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetHubSiteChild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPHubSiteChild")]
public class GetHubSiteChild : PnPAdminCmdlet
public class GetHubSiteChild : PnPSharePointOnlineAdminCmdlet
{
[Parameter(ValueFromPipeline = true, Mandatory = false)]
public HubSitePipeBind Identity;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetKnowledgeHubSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPKnowledgeHubSite")]
public class GetKnowledgeHubSite : PnPAdminCmdlet
public class GetKnowledgeHubSite : PnPSharePointOnlineAdminCmdlet
{
protected override void ExecuteCmdlet()
{
Expand Down
Loading

0 comments on commit fef7802

Please sign in to comment.