- PowerShell 7+ on Windows Server 2012 R2: FULLY SUPPORTED
- Execution Context: Runs under the FIM Sync Service account (typically
FIMSynchronizationServiceor the account the sync service runs under) - PowerShell 7 Features: All modern PS7+ features work perfectly (ternary operators, parallel processing, chain operators, etc.)
- Performance: Excellent - true out-of-process execution with full feature support
- PowerShell 7+ with Impersonation on Windows Server 2012 R2: ❌ NOT SUPPORTED
- Root Cause: Fundamental OS-level compatibility issues between:
- Windows Server 2012 R2's older process launching mechanisms
- .NET Core's security token handling
- PowerShell 7's process initialization requirements
- Error Behavior: Process crashes (0xc0000142) or initialization failures
- Windows Server 2019 or later required for PowerShell 7+ impersonation
- Alternative: Use Windows PowerShell 5.1 with impersonation on Server 2012 R2
| Platform | PowerShell 7+ | PS7+ with Impersonation | Windows PowerShell 5.1 | WinPS with Impersonation |
|---|---|---|---|---|
| Windows Server 2012 R2 | ✅ Supported | ❌ Not Supported | ✅ Supported | ✅ Supported |
| Windows Server 2016 | ✅ Supported | ✅ Supported | ✅ Supported | |
| Windows Server 2019+ | ✅ Supported | ✅ Supported | ✅ Supported | ✅ Supported |
- Automatic Detection: PSMA detects the platform and provides clear error messages when unsupported combinations are attempted
- Graceful Handling: Meaningful error messages explain the limitation instead of cryptic crashes
- Service Account Execution: When impersonation isn't used, PowerShell 7+ runs perfectly under the FIM Sync Service account context
For Windows Server 2012 R2 environments:
- Use PowerShell 7+ when possible (runs as sync service account)
- Use Windows PowerShell 5.1 when impersonation is required
- Upgrade to Windows Server 2019+ for full PowerShell 7+ impersonation support
This gives you the best of both worlds - modern PowerShell 7+ features when possible, with reliable fallback options for impersonation scenarios.