powershell icon indicating copy to clipboard operation
powershell copied to clipboard

[FEATURE] Get-PnPMicrosoft365Group doesn't return AssignedLabels

Open DaveTheTeamsGuy opened this issue 2 years ago • 3 comments

Reporting an Issue or Missing Feature

Get-PnPMicrosoft365Group doesn't return AssignedLabels. Confirmed a label is applied to the group(s) I am testing with. Confirmed AssignedLabels is visible in Graph Explorer. Confirmed PnP app has at least one of the required permissions (Directory.ReadWrite.All).

Expected behavior

Get-PnPMicrosoft365Group should return a result in AssignedLabels if a label is applied to a container.

Actual behavior

Get-PnPMicrosoft365Group doesn't return AssignedLabels

Steps to reproduce behavior

Get-PnPMicrosoft365Group -Identity <group GUID>

What is the version of the Cmdlet module you are running?

2.2.0

Which operating system/environment are you running PnP PowerShell on?

  • [x] Windows
  • [ ] Linux
  • [ ] MacOS
  • [ ] Azure Cloud Shell
  • [ ] Azure Functions
  • [ ] Other : please specify

DaveTheTeamsGuy avatar Jul 24 '23 20:07 DaveTheTeamsGuy

Hi @gautamdsheth As per the graph documentation AssignedLabels will only populate when it is added in the select property https://learn.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-1.0#properties

Should we add a Switch parameter to include sensitivity label ?

I can help with the feature update

kunj-sangani avatar Sep 29 '23 10:09 kunj-sangani

@kunj-sangani - it might be helpful only if the identity parameter. If we want to return all groups, then it doesn't work. I checked it in Graph explorer.

I guess, we need to ensure that it is available only if the Identity parameter is specified. What do you think ?

gautamdsheth avatar Oct 03 '23 17:10 gautamdsheth

@kunj-sangani - just checking in for an update. If you need assistance, feel free to let me know. I'm also more than happy to take care of the implementation if you're short on time. 😊

gautamdsheth avatar Jan 19 '24 17:01 gautamdsheth

@DaveTheTeamsGuy - closing this. Have added an additional parameter -IncludeSensitivityLabels which you need to specify to fetch sensitivity labels. It will be available in tomorrow's nightly as well as the next major release. Thanks for raising this feature request.

gautamdsheth avatar Jun 01 '24 16:06 gautamdsheth