AD-USER-18 - User script path count should be retrievable
Overviewβ
The ScriptPath attribute can launch scripts automatically during user sign-in. These scripts may map drives, alter environment settings, or execute legacy administrative logic.
- Execution surface: Logon scripts can introduce code execution paths during authentication
- Legacy dependency detection: Helps identify environments still relying on older sign-in automation
- Review priority: Highlights scripts and shares that may need access hardening or modernization
Security Recommendationβ
- Review every configured logon script for business need and secure coding practices
- Protect the storage locations that host scripts from unauthorized modification
- Retire unnecessary scripts and move critical logic to managed modern tooling where possible
How the Test Worksβ
This test counts user objects where the ScriptPath attribute contains a non-empty value.
Related Testsβ
Test-MtAdUserHomeDirectoryCount- Identifies related legacy provisioning settingsTest-MtAdUserProfilePathCount- Finds users with additional sign-in infrastructure dependencies
Test Metadataβ
| Field | Value |
|---|---|
| Test ID | AD-USER-18 |
| Severity | Info |
| Suite | Active Directory |
| Category | AD.User |
| PowerShell test | Test-MtAdUserScriptPathCount |
| Tags | AD, AD-USER-18, AD.User |
Sourceβ
- Pester test:
tests/ad/user/Test-MtAdUserScriptPathCount.Tests.ps1 - PowerShell source:
powershell/public/ad/user/Test-MtAdUserScriptPathCount.ps1

