microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Get-MgDeviceManagementDeviceCompliancePolicyAssignment does not show the Target value

Aperta
#2,399 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Bug
Lingua principale
C#
Stelle
898
Fork
230
Merge medio
2g 5h
PR unite (30g)
31

Descrizione

Thanks for reporting the bug. Please ensure you've gone through the following checklist before opening an issue:

Describe the bug
I cant see the Target of Assignment Compliance Policy in Intune using MS Graph
image

To Reproduce
Steps to reproduce the behavior:

Import-Module Microsoft.Graph.DeviceManagement
Get-MgDeviceManagementDeviceCompliancePolicyAssignment -DeviceCompliancePolicyId $deviceCompliancePolicyId

Expected behavior
I should see the Target value like on Graph Explorer
image

Debug Output
Get-MgDeviceManagementDeviceCompliancePolicyAssignment -DeviceCompliancePolicyId $CompliancePolicy.Id -Debug | FL
DEBUG: [CmdletBeginProcessing]: - Get-MgDeviceManagementDeviceCompliancePolicyAssignment begin processing with parameterSet 'List'.

Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): A
DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser', ContextScope: 'CurrentUser', AppName:
'Microsoft Graph Command Line Tools'.
DEBUG: [Authentication]: - Scopes: [Application.Read.All, AppRoleAssignment.ReadWrite.All, DeviceManagementApps.Read.All,
DeviceManagementConfiguration.ReadWrite.All, DeviceManagementManagedDevices.Read.All, DeviceManagementManagedDevices.ReadWrite.All,
Group.Read.All, openid, profile, User.Read, User.Read.All, email].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://graph.microsoft.com/v1.0/deviceManagement/deviceCompliancePolicies//assignments

Headers:
FeatureFlag : 00000043
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.19045; pl-PL),PowerShell/5.1.19041.3570
Accept-Encoding : gzip
SdkVersion : graph-powershell/2.8.0
client-request-id : 72e49bd1-0ebb-4eef-a23c-2dc09d346fe0

Body:

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

Status Code:
OK

Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id :
client-request-id :
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"Germany West
Central","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"FR2PEPF000001DC"}}
OData-Version : 4.0
Date : Fri, 03 Nov 2023 14:30:27 GMT

Body:
{
"@odata.context":
"https://graph.microsoft.com/v1.0/$metadata#deviceManagement/deviceCompliancePolicies('cc26ee06-ae41-49c2-8d6d-8b2c081778a0')/assignment
s",
"value": [
{
"id": "",
"target": {
"@odata.type": "#microsoft.graph.allDevicesAssignmentTarget"
}
}
]
}

Id :
Target : Microsoft.Graph.PowerShell.Models.MicrosoftGraphDeviceAndAppManagementAssignmentTarget
AdditionalProperties : {}

DEBUG: [CmdletEndProcessing]: - Get-MgDeviceManagementDeviceCompliancePolicyAssignment end processing.
image

Module Version
Get-Module Microsoft.Graph*

ModuleType Version Name ExportedCommands


Script 2.8.0 Microsoft.Graph.Authentication {Add-MgEnvironment, Connect-MgGraph, Disconnect-MgGraph, Get-MgContext...}
Script 2.8.0 Microsoft.Graph.DeviceManagement {Get-MgAdminEdge, Get-MgAdminEdgeInternetExplorerMode, Get-MgAdminEdgeInternetExplorerModeSiteList, Get-MgAdminEdgeInternetExplorerModeSiteListCount...}

Environment Data
$PSVersionTable

Name Value


PSVersion 5.1.19041.3570
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.3570
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Screenshots

Additional context

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo Get-MgDeviceManagementDeviceCompliancePolicyAssignment dal modulo Microsoft.Graph.DeviceManagement e confronta il suo output Target con Graph Explorer. Traccia il modello di assegnazione generato dal cmdlet e la gestione della risposta; il lavoro è completo quando viene esposto il valore Target restituito dall'API, invece del solo base assignment-target type.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp, powershell
Ambito
api, tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.