Skip to content

Conversation

@alexandair
Copy link
Collaborator

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new security assessment test (ID: 35004) for validating that sensitivity label policies are properly published to users, supporting Microsoft Information Protection deployment requirements.

Key Changes:

  • New assessment test to check for enabled label policies and their publication scope
  • Documentation with remediation steps for publishing label policies
  • Comprehensive unit tests covering success, failure, and error scenarios

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/powershell/tests/Test-Assessment.35004.ps1 Main assessment function that queries label policies, evaluates their enabled status and publication scope, and generates detailed reports with policy information
src/powershell/tests/Test-Assessment.35004.md User-facing documentation providing context, remediation steps, and links to Microsoft Learn resources for label policy management
code-tests/test-assessments/Test-Assessment.35004.Tests.ps1 Pester unit tests covering error handling, no policies, disabled policies, and enabled policies with different scopes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…rs" targeting


Consider adding SharePointLocation and OneDriveLocation to this condition for consistency.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 3, 2026 21:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
if ($policy.ModernGroupLocation) {
foreach ($target in $policy.ModernGroupLocation) { $null = $uniqueTargets.Add($target) }
}
Copy link

Copilot AI Jan 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code only counts unique targets from ExchangeLocation and ModernGroupLocation, but does not include SharePointLocation and OneDriveLocation when aggregating unique users/groups. This leads to an incomplete count when allUsersTargeted is false. SharePointLocation and OneDriveLocation should also be processed to add their targets to the uniqueTargets HashSet.

Suggested change
}
}
if ($policy.SharePointLocation) {
foreach ($target in $policy.SharePointLocation) { $null = $uniqueTargets.Add($target) }
}
if ($policy.OneDriveLocation) {
foreach ($target in $policy.OneDriveLocation) { $null = $uniqueTargets.Add($target) }
}

Copilot uses AI. Check for mistakes.
Update MinimumLicense from MIP_P1 to Microsoft 365 E3
Copy link
Collaborator

@SagarSathe SagarSathe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SagarSathe SagarSathe merged commit 0887b00 into microsoft:main Jan 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants