microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Get-MgBetaReportMicrosoft365CopilotUsageUserDetail Generates CSV with duplicate column

Offen
#3,155 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Service issue type:bug
Vorherrschende Sprache
C#
Sterne
898
Forks
230
Ø Merge
2 T. 5 Std.
Gemergte PRs (30 T.)
31

Beschreibung

Describe the bug

Apart from not generating any useful informatiion at all, the Get-MgBetaReportMicrosoft365CopilotUsageUserDetail cmdlet includes two columns called copilotChatLastActivityDate:"". When data is retrieved (which I assume the cmdlet will one day), the resulting output cannot be loaded by the Import-CSV function because of the duplicate column (which also has a horrible name).

Expected behavior

I expect the cmdlet to return useful data in a form that means you don't need to edit the CSV file before it can be imported.

How to reproduce

Get-MgBetaReportMicrosoft365CopilotUsageUserDetail -Period 'D180' -OutFile c:\temp\Copilot.CSV
$Data = Import-CSV c:\temp\Copilot.CSV
Import-Csv: The member "copilotChatLastActivityDate:""" is already present.

Image

SDK Version

V2.26

Latest version known to work for scenario above?

Never

Known Workarounds

Use the Graph API request

Debug output

Get-MgBetaReportMicrosoft365CopilotUsageUserDetail -Period 'D180' -OutFile c:\temp\Copilot3.csv -debug
DEBUG: [CmdletBeginProcessing]: - Get-MgBetaReportMicrosoft365CopilotUsageUserDetail begin processing with parameterSet 'Get'.
DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser', ContextScope: 'CurrentUser', AppName: 'Microsoft Graph Command Line Tools'.
DEBUG: [Authentication]: - Scopes: [AccessReview.Read.All, Agreement.Read.All, Analytics.Read, APIConnectors.Read.All, Application.Read.All, Application.ReadWrite.All, AppRoleAssignment.ReadWrite.All, AuditLog.Read.All, AuditLogsQuery.Read.All, BackupRestore-Control.Read.All, Calendars.Read, Calendars.ReadWrite, Channel.ReadBasic.All, ChannelMessage.Read.All, ChannelMessage.ReadWrite, ChannelMessage.Send, ChannelSettings.Read.All, ChannelSettings.ReadWrite.All, Chat.Create, Chat.ManageDeletion.All, Chat.ReadWrite, Community.ReadWrite.All, Contacts.ReadWrite, CopilotSettings-LimitedMode.ReadWrite, CrossTenantUserProfileSharing.Read, CrossTenantUserProfileSharing.Read.All, DelegatedPermissionGrant.ReadWrite.All, DeviceManagementManagedDevices.Read.All, Directory.AccessAsUser.All, Directory.Read.All, Directory.ReadWrite.All, DirectoryRecommendations.Read.All, Domain.Read.All, eDiscovery.Read.All, email, EntitlementManagement.Read.All, Files.Read, Files.Read.All, Group.Read.All, Group.ReadWrite.All, GroupMember.Read.All, GroupMember.ReadWrite.All, IdentityProvider.Read.All, IdentityProvider.ReadWrite.All, IdentityRiskEvent.Read.All, IdentityRiskyUser.Read.All, IdentityRiskyUser.ReadWrite.All, IdentityUserFlow.Read.All, InformationProtectionPolicy.Read, Mail.Read, Mail.ReadWrite, Mail.Send, Mail.Send.Shared, MailboxSettings.ReadWrite, Notes.Create, OnlineMeetingArtifact.Read.All, OnlineMeetings.Read, OnPremDirectorySynchronization.ReadWrite.All, openid, Organization.Read.All, PeopleSettings.Read.All, PeopleSettings.ReadWrite.All, Place.Read.All, Policy.Read.All, Policy.Read.ConditionalAccess, Policy.Read.PermissionGrant, Policy.ReadWrite.ApplicationConfiguration, Policy.ReadWrite.AuthenticationMethod, Policy.ReadWrite.ConditionalAccess, POP.AccessAsUser.All, Presence.Read.All, PrivilegedAccess.Read.AzureAD, PrivilegedAccess.Read.AzureResources, profile, RecordsManagement.Read.All, Reports.Read.All, ReportSettings.ReadWrite.All, RoleAssignmentSchedule.Read.Directory, RoleAssignmentSchedule.ReadWrite.Directory, RoleEligibilitySchedule.Read.Directory, RoleEligibilitySchedule.ReadWrite.Directory, RoleEligibilitySchedule.Remove.Directory, RoleManagement.Read.All, RoleManagement.Read.Directory, RoleManagement.ReadWrite.Directory, SecurityActions.ReadWrite.All, SecurityEvents.Read.All, SecurityEvents.ReadWrite.All, ServiceHealth.Read.All, ServiceMessage.Read.All, SharePointTenantSettings.Read.All, SharePointTenantSettings.ReadWrite.All, Sites.FullControl.All, Sites.Manage.All, Sites.Read.All, Sites.ReadWrite.All, Tasks.Read, Tasks.ReadWrite, Team.ReadBasic.All, TeamMember.Read.All, TeamSettings.Read.All, TeamsTab.Read.All, TeamworkTag.ReadWrite, User.EnableDisableAccount.All, User.Read, User.Read.All, User.ReadBasic.All, User.ReadWrite, User.ReadWrite.All, UserActivity.ReadWrite.CreatedByApp, UserAuthenticationMethod.Read.All, UserAuthenticationMethod.ReadWrite.All, User-ConvertToInternal.ReadWrite.All, VirtualEvent.Read, WindowsUpdates.Read.All].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://graph.microsoft.com/beta/reports/microsoft.graph.getMicrosoft365CopilotUsageUserDetail(period='D180')

Headers:
FeatureFlag : 00000003
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.26100; en-IE),PowerShell/7.5.0
SdkVersion : graph-powershell-beta/2.26.0
client-request-id : 972ddd4e-7425-4805-b346-c77070ba9f92
Accept-Encoding : gzip,deflate,br

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Cache-Control : no-store, no-cache, max-age=0, s-maxage=0, private
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 63cddaf5-4f05-4cc5-9061-d1e16a7a26c8
client-request-id : 972ddd4e-7425-4805-b346-c77070ba9f92
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"North Europe","Slice":"E","Ring":"4","ScaleUnit":"007","RoleInstance":"DU6PEPF000165C1"}}
Date : Fri, 21 Feb 2025 10:49:18 GMT

Body:
{
"value": [
{
"reportRefreshDate": "2025-02-17",
"userPrincipalName": "Sean.Landy@office365itpros.com",
"displayName": "Sean Landy",
"lastActivityDate": "2024-12-19",
"copilotChatLastActivityDate": "",
"microsoftTeamsCopilotLastActivityDate": "2024-12-19",
"wordCopilotLastActivityDate": "",
"excelCopilotLastActivityDate": "",
"powerPointCopilotLastActivityDate": "",
"outlookCopilotLastActivityDate": "",
"oneNoteCopilotLastActivityDate": "",
"loopCopilotLastActivityDate": "",
"copilotActivityUserDetailsByPeriod": [
{
"reportPeriod": 180
}
]
},

Configuration

No response

Other information

Notice that the debug output shows that data is downloaded but it never shows up in the output CSV

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit Get-MgBetaReportMicrosoft365CopilotUsageUserDetail und reproduziere die im Issue gezeigte D180-Anfrage, indem du die Graph-Antwort mit der generierten CSV vergleichst. Untersuche, warum das Feld copilotChatLastActivityDate dupliziert oder fehlerhaft ist, und überprüfe, dass die heruntergeladenen Daten einmal pro Spalte erscheinen und mit Import-Csv ohne Bearbeitung geladen werden können.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
powershell
Bereich
api, cli
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.