Architecture
Service Lifecycle
Intune Commander uses a hybrid dependency injection model: Registered in DI (Singleton)IAuthenticationProvider- Handles credential creationIntuneGraphClientFactory- Creates authenticated Graph clientsProfileService- Manages tenant profilesICacheService- LiteDB-backed caching layerIProfileEncryptionService- DataProtection-based encryption
Service Registration
All Core services are registered via the extension method:- DataProtection with file-based key storage at
%LocalAppData%/Intune.Commander/keys - Legacy key migration from
IntuneManagerpaths - Singleton authentication and factory services
- Transient export service
ServiceCollectionExtensions.cs:10 for the complete registration.
Multi-Cloud Support
Intune Commander supports four Microsoft cloud environments:| Environment | Graph Endpoint | Authority Host |
|---|---|---|
| Commercial | https://graph.microsoft.com/beta | Azure Public Cloud |
| GCC | https://graph.microsoft.com/beta | Azure Public Cloud |
| GCC-High | https://graph.microsoft.us/beta | Azure Government |
| DoD | https://dod-graph.microsoft.us/beta | Azure Government |
TenantProfile.Cloud property. See CloudEndpoints.cs:7 for endpoint resolution logic.
Graph API Service Pattern
All Graph services follow a consistent interface pattern:DeviceConfiguration, DeviceCompliancePolicy, etc.) with no custom model layer.
Key Services
Configuration Management
IConfigurationProfileService- Device configuration profilesICompliancePolicyService- Compliance policiesISettingsCatalogService- Settings catalog policiesIEndpointSecurityService- Endpoint security intentsIAdministrativeTemplateService- ADMX-backed administrative templates
Application Management
IApplicationService- Mobile applicationsIAppProtectionPolicyService- App protection policiesIManagedAppConfigurationService- Managed app configurations
Scripts and Remediation
IDeviceManagementScriptService- PowerShell scripts (Windows)IDeviceShellScriptService- Shell scripts (macOS)IDeviceHealthScriptService- Proactive remediation scriptsIComplianceScriptService- Custom compliance scripts
Windows Update Management
IFeatureUpdateProfileService- Windows feature updatesIQualityUpdateProfileService- Windows quality updatesIDriverUpdateProfileService- Windows driver updates
Enrollment and Provisioning
IEnrollmentConfigurationService- Enrollment restrictions and ESPIAutopilotService- Windows Autopilot profilesIAppleDepService- Apple DEP tokens
Identity and Access
IConditionalAccessPolicyService- Conditional Access policiesIAuthenticationStrengthService- Authentication strength policiesIAuthenticationContextService- Authentication contextsINamedLocationService- Named locationsITermsOfUseService- Terms of Use agreements
Organization
IGroupService- Azure AD groups with assignment lookupIUserService- User managementIScopeTagService- Role-based access scope tagsIRoleDefinitionService- Custom RBAC role definitions
Data Management
IExportService- Export configurations to JSONIImportService- Import configurations with ID remappingICacheService- Encrypted LiteDB cache with TTL
Error Handling
Services throw Graph SDK exceptions directly:ServiceException- Graph API errors with status codesUnauthorizedException- 401 authentication failuresForbiddenException- 403 permission errors
Next Steps
Authentication
Credential types, Graph client factory, multi-cloud auth
Graph Services
Device configs, compliance, apps, scripts with method signatures
Cache Service
LiteDB storage, encryption, TTL, polymorphic deserialization
Export Service
JSON export, import with ID remapping, migration tables