-
Notifications
You must be signed in to change notification settings - Fork 120
35007 - Add test for Information Rights Management (IRM) in SharePoint Online #731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 assessment test (ID: 35007) to check if legacy Information Rights Management (IRM) is enabled in SharePoint Online. The test identifies organizations still using the deprecated IRM feature and recommends migrating to modern sensitivity labels.
- Implements test logic to query SharePoint tenant IRM settings via
Get-SPOTenant - Provides remediation guidance for disabling IRM and migrating to modern sensitivity labels
- Includes comprehensive unit tests covering pass, fail, and error scenarios
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/powershell/tests/Test-Assessment.35007.ps1 | Main assessment function that checks IRM status and generates test results |
| src/powershell/tests/Test-Assessment.35007.md | Documentation with remediation steps and migration guidance to sensitivity labels |
| code-tests/test-assessments/Test-Assessment.35007.Tests.ps1 | Pester unit tests covering IRM enabled, disabled, and error scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
capabilitiy --> capability Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Permisionss --> Permissions Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this 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.
There was a problem hiding this 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 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $passed = $false | ||
| } | ||
| else { | ||
| $passed = $null -ne $spoTenant -and $spoTenant.IrmEnabled -eq $true |
Copilot
AI
Jan 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assessment logic is inverted. When IrmEnabled is true, the test should fail (not pass) because the legacy IRM feature being enabled is the problem. Currently, line 54 sets $passed = $true when IrmEnabled is true, but based on the test description and report messages (lines 65-68), IRM being enabled should result in a failed test. The condition should be: $passed = $null -ne $spoTenant -and $spoTenant.IrmEnabled -eq $false
| $passed = $null -ne $spoTenant -and $spoTenant.IrmEnabled -eq $true | |
| $passed = $null -ne $spoTenant -and $spoTenant.IrmEnabled -eq $false |
| @@ -0,0 +1,18 @@ | |||
| Information Rights Management (IRM) integration in SharePoint Online libraries is a legacy feature that has been replaced by Enhanced SharePoint Permissions (ESP). Any library using this legacy capability should be flagged to move to newer capabilities. | |||
Copilot
AI
Jan 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a spelling error in the word "capability" which is misspelled as "capabilitiy" (missing 'l').
Pass Condition: Returns `$false` or `$null` (not configured
```powershell
$passed = $null -ne $spoTenant -and $spoTenant.IrmEnabled -ne $true
```
SagarSathe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix https://github.com/microsoft/ztspecs/issues/50