You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add a readable service account type field for sMSA/MSA, gMSA, and dMSA object classes
query dMSA migration attributes when the schema supports them
retry without dMSA-only attributes on older schemas so existing MSA/gMSA reports keep working
highlight dMSA rows in the ServiceAccounts report
Why
The ServiceAccounts report used Get-ADServiceAccount, which covers sMSA/MSA and gMSA and is also the cmdlet Microsoft documents for dMSA. The report only exposed ObjectClass, though, so readers had to know the schema class names and dMSA migration state was not surfaced.
Validation
Test-ModuleManifest .\ADEssentials.psd1
Import-Module .\ADEssentials.psd1 -Force
ConvertTo-WinADServiceAccountType samples for MSA, gMSA, dMSA, and unknown classes
Proper use of AD cmdlets without direct LDAP injection risks
No credential handling or secrets exposure
Read-only operations with appropriate error handling
🧪 Test Coverage
Missing test coverage for new functions:
No tests found for ConvertTo-WinADServiceAccountType
No tests found for Test-WinADSchemaAttribute
Existing test structure appears minimal based on Tests directory content
Manual validation mentioned in PR description is good but automated tests would be better
📋 Minor Issues
1. Documentation
Test-WinADSchemaAttribute.ps1: Missing comprehensive help documentation (synopsis, description, examples)
ConvertTo-WinADServiceAccountType.ps1: No help documentation
2. Code Style
Get-WinADServiceAccount.ps1:58-60: Consider moving $DmsaProperties definition closer to where it's used or make it a module-level constant
Recommendations
Add unit tests for the new helper functions
Consider caching schema attribute checks within the same forest context
Add comprehensive help documentation for new Private functions
Consider more descriptive error messages in the fallback scenarios
Overall Assessment
This is a well-implemented feature that significantly improves the usability of service account reporting. The backward compatibility approach is particularly commendable, ensuring existing workflows continue to function while adding valuable new functionality. The code follows PowerShell best practices and maintains consistency with the existing codebase.
Recommendation: ✅ Approve - This PR adds valuable functionality with minimal risk and good engineering practices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
The ServiceAccounts report used Get-ADServiceAccount, which covers sMSA/MSA and gMSA and is also the cmdlet Microsoft documents for dMSA. The report only exposed ObjectClass, though, so readers had to know the schema class names and dMSA migration state was not surfaced.
Validation