msec
0.2.0
Minimum PowerShell version
7.0
Installation Options
Owners
Copyright
(c) 2026 Anton Lindström. Licensed under the MIT License.
Package Details
Author(s)
- Anton Lindstrom
Tags
MicrosoftSecurity Security SecureScore Defender DefenderXDR ExposureManagement Entra EntraID AzureAD ConditionalAccess MFA PIM PrivilegedAccess Intune MDM Compliance Azure ExchangeOnline SharePointOnline Microsoft365 KeyVault Graph Audit Posture CrossPlatform Windows Linux macOS
Functions
New-MsecApp Connect-Msec Disconnect-Msec Connect-MsecGraphSdk Connect-MsecExchangeOnline Connect-MsecSharePointOnline Get-MsecSecureScore Get-MsecAzureCost Get-MsecAzureSecureScore Get-MsecDefenderScoreExposure Get-MsecDefenderScoreDeviceConfiguration Get-MsecDefenderDevice Get-MsecDefenderEmailStats Get-MsecDefenderIncidentStats Get-MsecKeyVaultCertificate Get-MsecIntuneConfigurationProfile Get-MsecIntuneCompliancePolicy Get-MsecIntuneDevice Get-MsecIntuneScriptResult Get-MsecEntraConditionalAccessPolicy Get-MsecEntraConditionalAccessSignInLog Get-MsecEntraConditionalAccessStats Get-MsecEntraTenantSecuritySetting Get-MsecExchangeMailboxPermission Get-MsecSharePointSite Get-MsecSharePointSiteUser Get-MsecEntraGroupMember Get-MsecEntraLicense Get-MsecEntraRoleHolder Get-MsecEntraAppCredential Get-MsecEntraMfaRegistration Get-MsecEntraMfaEvidence Get-MsecEntraMfaRegistrationStats Get-MsecEntraDisabledUser Convert-MsecEntraSid Search-MsecAzureResourceGraph Search-MsecLogAnalytics Invoke-MsecAzureVMScript Select-MsecAzureContext Get-MsecAdoServiceConnection Export-MsecPostureReport Export-MsecVMUpdateReport Export-MsecVMNtpReport Export-MsecEntraDisabledUserReport Export-MsecDefenderDeviceReport Export-MsecEntraGroupMemberReport
Dependencies
Release Notes
v0.2.0
- Exchange Online and SharePoint Online: mailbox permissions, site inventory, and site
owners/members with security groups expanded to the people inside them.
- Bridges that let the Microsoft.Graph SDK, ExchangeOnlineManagement and PnP.PowerShell
run as the msec app without the certificate's private key reaching the machine.
- Azure: unused resources, network exposure across twelve resource types, Key Vault
certificate expiry, Cost Management, App Service inventory and stack settings.
- Entra: group members (nested groups expanded, PIM-eligible included), app registration
and service principal credential expiry.
- Defender: device inventory with per-device vulnerability counts.
- Evidence reports for Defender devices and Entra group membership; the posture report
gained privileged access, device platform and OS release measurements.
- New-MsecApp -Workload Exchange, SharePoint grants those workloads' permissions. Exchange
additionally needs a DIRECTORY ROLE - an app role alone is not enough, and without one
every Exchange call fails with an authorisation error that names nothing.
v0.1.0
- First release. Read-only Microsoft security posture as flat objects: Secure Score,
Defender XDR, Entra ID (roles, Conditional Access, MFA, licensing), Intune and Azure.
- Certificate-based auth against an app registration; the private key stays in Azure
Key Vault and signing happens there.
See CHANGELOG.md for full version history.
FileList
- Msec.nuspec
- Kql\Graph\AppGateway\All.kql
- Kql\Graph\AppGateway\Backends.kql
- Kql\Graph\AppGateway\Sites.kql
- Kql\Graph\AppService\All.kql
- Kql\Graph\AppService\StackSettings.kql
- Kql\Graph\KeyVault\All.kql
- Kql\Graph\KeyVault\NetworkRules.kql
- Kql\Graph\LogAnalytics\All.kql
- Kql\Graph\MySQL\All.kql
- Kql\Graph\NSG\All.kql
- Kql\Graph\NSG\SecurityRules.kql
- Kql\Graph\Policy\All.kql
- Kql\Graph\Policy\Compliance.kql
- Kql\Graph\Policy\DiagnosticSettings.kql
- Kql\Graph\Resource\All.kql
- Kql\Graph\Resource\Inventory.kql
- Kql\Graph\Resource\NetworkExposure.kql
- Kql\Graph\Resource\Unused.kql
- Kql\Graph\Storage\All.kql
- Kql\Graph\Storage\NetworkRules.kql
- Kql\Graph\VM\All.kql
- Kql\Graph\VM\LastUpdated.kql
- Kql\Graph\VM\PendingUpdates.kql
- Kql\Graph\VM\UpdateReadiness.kql
- Kql\Graph\Waf\All.kql
- Kql\Graph\Waf\CustomRules.kql
- Kql\Graph\Waf\Exclusions.kql
- Kql\Graph\Waf\ManagedRules.kql
- Kql\Law\VM\All.kql
- Kql\Law\VM\Heartbeat.kql
- Kql\Law\VM\SecurityEvents.kql
- Kql\Law\VM\Syslog.kql
- Kql\Law\VM\WindowsEvents.kql
- Kql\Law\Waf\All.kql
- Kql\Law\Waf\TopRules.kql
- Msec.format.ps1xml
- Msec.psd1
- Msec.psm1
- Private\Add-MsecExcelDashboard.ps1
- Private\Add-MsecExcelRow.ps1
- Private\Assert-MsecExcelWorkbook.ps1
- Private\Assert-MsecSession.ps1
- Private\Confirm-MsecEvidenceOverwrite.ps1
- Private\ConvertTo-MsecAssignmentTarget.ps1
- Private\ConvertTo-MsecBase64Url.ps1
- Private\ConvertTo-MsecDeviceOsRelease.ps1
- Private\ConvertTo-MsecExcelColumn.ps1
- Private\ConvertTo-MsecExcelSheetName.ps1
- Private\ConvertTo-MsecRolePrincipalRow.ps1
- Private\Get-MsecAccessToken.ps1
- Private\Get-MsecCachePath.ps1
- Private\Get-MsecCertificateMetadata.ps1
- Private\Get-MsecEnvironment.ps1
- Private\Get-MsecExcelHeader.ps1
- Private\Get-MsecExcelRowCount.ps1
- Private\Get-MsecGraphCacheName.ps1
- Private\Get-MsecGraphErrorMessage.ps1
- Private\Get-MsecPolicyStatus.ps1
- Private\Get-MsecPrincipalDisplayKey.ps1
- Private\Get-MsecPrincipalObjectType.ps1
- Private\Get-MsecPrivilegedRoleTemplate.ps1
- Private\Get-MsecSettingsCatalogStatusReport.ps1
- Private\Get-MsecSubscriptionList.ps1
- Private\Get-MsecTenantProfile.ps1
- Private\Invoke-MsecAzureVMScriptCore.ps1
- Private\Invoke-MsecDefenderRequest.ps1
- Private\Invoke-MsecGraphRequest.ps1
- Private\Invoke-MsecKeyVaultSign.ps1
- Private\New-MsecClientAssertion.ps1
- Private\New-MsecGroupMemberRow.ps1
- Private\Read-MsecCache.ps1
- Private\Resolve-MsecAzureVMScriptDispatch.ps1
- Private\Resolve-MsecEvidenceSheet.ps1
- Private\Resolve-MsecSubscription.ps1
- Private\Save-MsecCache.ps1
- Private\Save-MsecTenantProfile.ps1
- Private\Test-MsecPrincipalUnnamed.ps1
- Private\Write-MsecEvidenceWorkbook.ps1
- Private\Write-MsecExcelSheet.ps1
- Private\Write-MsecExcelTable.ps1
- Private\Write-MsecVMEvidenceWorkbook.ps1
- Public\Connect-Msec.ps1
- Public\Connect-MsecExchangeOnline.ps1
- Public\Connect-MsecGraphSdk.ps1
- Public\Connect-MsecSharePointOnline.ps1
- Public\Convert-MsecEntraSid.ps1
- Public\Disconnect-Msec.ps1
- Public\Export-MsecDefenderDeviceReport.ps1
- Public\Export-MsecEntraDisabledUserReport.ps1
- Public\Export-MsecEntraGroupMemberReport.ps1
- Public\Export-MsecPostureReport.ps1
- Public\Export-MsecVMNtpReport.ps1
- Public\Export-MsecVMUpdateReport.ps1
- Public\Get-MsecAdoServiceConnection.ps1
- Public\Get-MsecAzureCost.ps1
- Public\Get-MsecAzureSecureScore.ps1
- Public\Get-MsecDefenderDevice.ps1
- Public\Get-MsecDefenderEmailStats.ps1
- Public\Get-MsecDefenderIncidentStats.ps1
- Public\Get-MsecDefenderScoreDeviceConfiguration.ps1
- Public\Get-MsecDefenderScoreExposure.ps1
- Public\Get-MsecEntraAppCredential.ps1
- Public\Get-MsecEntraConditionalAccessPolicy.ps1
- Public\Get-MsecEntraConditionalAccessSignInLog.ps1
- Public\Get-MsecEntraConditionalAccessStats.ps1
- Public\Get-MsecEntraDisabledUser.ps1
- Public\Get-MsecEntraGroupMember.ps1
- Public\Get-MsecEntraLicense.ps1
- Public\Get-MsecEntraMfaEvidence.ps1
- Public\Get-MsecEntraMfaRegistration.ps1
- Public\Get-MsecEntraMfaRegistrationStats.ps1
- Public\Get-MsecEntraRoleHolder.ps1
- Public\Get-MsecEntraTenantSecuritySetting.ps1
- Public\Get-MsecExchangeMailboxPermission.ps1
- Public\Get-MsecIntuneCompliancePolicy.ps1
- Public\Get-MsecIntuneConfigurationProfile.ps1
- Public\Get-MsecIntuneDevice.ps1
- Public\Get-MsecIntuneScriptResult.ps1
- Public\Get-MsecKeyVaultCertificate.ps1
- Public\Get-MsecSecureScore.ps1
- Public\Get-MsecSharePointSite.ps1
- Public\Get-MsecSharePointSiteUser.ps1
- Public\Invoke-MsecAzureVMScript.ps1
- Public\New-MsecApp.ps1
- Public\Search-MsecAzureResourceGraph.ps1
- Public\Search-MsecLogAnalytics.ps1
- Public\Select-MsecAzureContext.ps1
- Scripts\Intune\Windows\entra-local-admins\README.md
- Scripts\Intune\Windows\entra-local-admins\detect.ps1
- Scripts\Intune\Windows\remove-local-admin\README.md
- Scripts\Intune\Windows\remove-local-admin\detect.ps1
- Scripts\Intune\Windows\remove-local-admin\remediate.ps1
- Scripts\Intune\macOS\local-admins\README.md
- Scripts\Intune\macOS\local-admins\custom-attribute.sh
- Scripts\README.md
- Scripts\VM\Linux\ntp-status.sh
- Scripts\VM\Linux\os-info.sh
- Scripts\VM\Linux\update-status.sh
- Scripts\VM\Windows\eset-config.ps1
- Scripts\VM\Windows\ntp-status.ps1
- Scripts\VM\Windows\os-info.ps1
- Scripts\VM\Windows\update-status.ps1
- Tests\Connect-MsecGraphSdk.Tests.ps1
- Tests\Convert-MsecEntraSid.Tests.ps1
- Tests\ConvertTo-MsecAssignmentTarget.Tests.ps1
- Tests\ConvertTo-MsecRolePrincipalRow.Tests.ps1
- Tests\Export-MsecDefenderDeviceReport.Tests.ps1
- Tests\Export-MsecEntraDisabledUserReport.Tests.ps1
- Tests\Export-MsecEntraGroupMemberReport.Tests.ps1
- Tests\Export-MsecPostureReport.Tests.ps1
- Tests\Export-MsecVMNtpReport.Tests.ps1
- Tests\Export-MsecVMUpdateReport.Tests.ps1
- Tests\Get-MsecAccessToken.Tests.ps1
- Tests\Get-MsecAdoServiceConnection.Tests.ps1
- Tests\Get-MsecAzureCost.Tests.ps1
- Tests\Get-MsecAzureSecureScore.Tests.ps1
- Tests\Get-MsecDefenderDevice.Tests.ps1
- Tests\Get-MsecDefenderEmailStats.Tests.ps1
- Tests\Get-MsecDefenderIncidentStats.Tests.ps1
- Tests\Get-MsecEntraAppCredential.Tests.ps1
- Tests\Get-MsecEntraConditionalAccessPolicy.Tests.ps1
- Tests\Get-MsecEntraConditionalAccessSignInLog.Tests.ps1
- Tests\Get-MsecEntraConditionalAccessStats.Tests.ps1
- Tests\Get-MsecEntraDisabledUser.Tests.ps1
- Tests\Get-MsecEntraGroupMember.Tests.ps1
- Tests\Get-MsecEntraLicense.Tests.ps1
- Tests\Get-MsecEntraMfaEvidence.Tests.ps1
- Tests\Get-MsecEntraMfaRegistration.Tests.ps1
- Tests\Get-MsecEntraMfaRegistrationStats.Tests.ps1
- Tests\Get-MsecEntraRoleHolder.Tests.ps1
- Tests\Get-MsecEntraTenantSecuritySetting.Tests.ps1
- Tests\Get-MsecEnvironment.Tests.ps1
- Tests\Get-MsecIntuneCompliancePolicy.Tests.ps1
- Tests\Get-MsecIntuneConfigurationProfile.Tests.ps1
- Tests\Get-MsecIntuneDevice.Tests.ps1
- Tests\Get-MsecIntuneScriptResult.Tests.ps1
- Tests\Get-MsecKeyVaultCertificate.Tests.ps1
- Tests\Get-MsecSecureScore.Tests.ps1
- Tests\IntuneRemediationScripts.Tests.ps1
- Tests\Invoke-MsecAzureVMScript.Tests.ps1
- Tests\Invoke-MsecGraphRequest.Tests.ps1
- Tests\MsecCompletionCache.Tests.ps1
- Tests\MsecFormatData.Tests.ps1
- Tests\MsecManifest.Tests.ps1
- Tests\MsecTenantProfile.Tests.ps1
- Tests\MsecWorkloadConnect.Tests.ps1
- Tests\New-MsecApp.Tests.ps1
- Tests\New-MsecClientAssertion.Tests.ps1
- Tests\Search-MsecAzureResourceGraph.Tests.ps1
- Tests\Search-MsecLogAnalytics.Tests.ps1
- Tests\Select-MsecAzureContext.Tests.ps1
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 0.3.0 | 18 | 9/9/2026 |
| 0.2.0 (current version) | 6 | 9/7/2026 |
| 0.1.1 | 16 | 8/20/2026 |
| 0.1.0 | 3 | 8/20/2026 |