Get-AzPolicyAttestation
Hiermee haalt u beleidsverklaringen op.
Syntaxis
Get-AzPolicyAttestation
[-Top <Int32>]
[-Filter <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzPolicyAttestation
-Name <String>
[-Scope <String>]
[-ResourceGroupName <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzPolicyAttestation
-Scope <String>
[-Top <Int32>]
[-Filter <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzPolicyAttestation
-ResourceGroupName <String>
[-Top <Int32>]
[-Filter <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzPolicyAttestation
-ResourceId <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Met de cmdlet Get-AzPolicyAttestation worden alle beleidsverklaringen in een bereik of een bepaalde attestation opgenomen.
Voorbeelden
Voorbeeld 1: Alle beleidsverklaringen ophalen in het huidige abonnement
Set-AzContext -Subscription "d1acb22b-c876-44f7-b08e-3fcf9f6767f4"
Get-AzPolicyAttestation
Id : /subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/providers/microsoft.policyinsights/attestations/
attestation-subscription
Name : attestation-subscription
Type : Microsoft.PolicyInsights/attestations
PolicyAssignmentId : /subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/providers/microsoft.authorization/policyassignme
nts/psattestationsubassignment
PolicyDefinitionReferenceId :
ComplianceState : NonCompliant
ExpiresOn :
Owner :
Comment : Setting the state to non compliant
Evidence :
ProvisioningState : Succeeded
LastComplianceStateChangeAt : 1/27/2023 4:00:04 PM
AssessmentDate :
Metadata :
SystemData :
Id : /subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/resourcegroups/ps-attestation-test-rg/providers/
microsoft.policyinsights/attestations/attestation-rg
Name : attestation-rg
Type : Microsoft.PolicyInsights/attestations
PolicyAssignmentId : /subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/providers/microsoft.authorization/policyassignme
nts/psattestationrgassignment
PolicyDefinitionReferenceId :
ComplianceState :
ExpiresOn : 1/27/2024 4:04:24 PM
Owner :
Comment :
Evidence :
ProvisioningState : Succeeded
LastComplianceStateChangeAt : 1/27/2023 4:04:11 PM
AssessmentDate :
Metadata :
SystemData :
Id : /subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/resourcegroups/ps-attestation-test-rg/providers/
microsoft.network/networksecuritygroups/pstests0/providers/microsoft.policyinsights/attestations/att
estation-resource
Name : attestation-resource
Type : Microsoft.PolicyInsights/attestations
PolicyAssignmentId : /subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/providers/microsoft.authorization/policyassignme
nts/psattestationresourceassignment
PolicyDefinitionReferenceId :
ComplianceState : NonCompliant
ExpiresOn :
Owner : Test Owner 2
Comment :
Evidence :
ProvisioningState : Succeeded
LastComplianceStateChangeAt : 1/27/2023 2:38:17 AM
AssessmentDate :
Metadata :
SystemData :
Id : /subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/resourcegroups/ps-attestation-test-rg/providers/
microsoft.policyinsights/attestations/attestationrgallprops
Name : attestationRGAllProps
Type : Microsoft.PolicyInsights/attestations
PolicyAssignmentId : /subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/providers/microsoft.authorization/policyassignme
nts/psattestationinitiativergassignment
PolicyDefinitionReferenceId : pstestattestationrg_1
ComplianceState :
ExpiresOn : 1/27/2024 2:51:54 AM
Owner : Test Owner
Comment :
Evidence : {Microsoft.Azure.Commands.PolicyInsights.Models.Attestations.PSAttestationEvidence}
ProvisioningState : Succeeded
LastComplianceStateChangeAt : 1/27/2023 2:51:57 AM
AssessmentDate : 1/25/2024 2:51:54 AM
Metadata : {
"TestKey": "TestValue"
}
SystemData :
Met deze opdracht worden alle attestations opgehaald die zijn gemaakt bij of onder een abonnement met id d1acb22b-c876-44f7-b08e-3fcf9f6767f4.
Voorbeeld 2: Een specifieke beleidsverklaring ophalen
Get-AzPolicyAttestation -ResourceGroupName "ps-attestation-test-rg" -Name "attestation-RG"
Id : /subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/resourcegroups/ps-attestation-test-rg/providers/
microsoft.policyinsights/attestations/attestation-rg
Name : attestation-rg
Type : Microsoft.PolicyInsights/attestations
PolicyAssignmentId : /subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/providers/microsoft.authorization/policyassignme
nts/psattestationrgassignment
PolicyDefinitionReferenceId :
ComplianceState :
ExpiresOn : 1/27/2024 4:04:24 PM
Owner :
Comment :
Evidence :
ProvisioningState : Succeeded
LastComplianceStateChangeAt : 1/27/2023 4:04:11 PM
AssessmentDate :
Metadata :
SystemData :
Met deze opdracht haalt u de attestation met de naam 'attestation-RG' op in de resourcegroep 'ps-attestation-test-rg'.
Voorbeeld 3: 5 beleidsverklaringen ophalen in een abonnement met optionele filters
Set-AzContext -Subscription "d1acb22b-c876-44f7-b08e-3fcf9f6767f4"
Get-AzPolicyAttestation -Top 5 -Filter "PolicyAssignmentId eq '/subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/providers/microsoft.authorization/policyassignments/psattestationresourceassignment'"
Id : /subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/resourcegroups/ps-attestation-test-rg/providers/
microsoft.network/networksecuritygroups/pstests0/providers/microsoft.policyinsights/attestations/att
estation-resource
Name : attestation-resource
Type : Microsoft.PolicyInsights/attestations
PolicyAssignmentId : /subscriptions/d1acb22b-c876-44f7-b08e-3fcf9f6767f4/providers/microsoft.authorization/policyassignme
nts/psattestationresourceassignment
PolicyDefinitionReferenceId :
ComplianceState : NonCompliant
ExpiresOn :
Owner : Test Owner 2
Comment :
Evidence :
ProvisioningState : Succeeded
LastComplianceStateChangeAt : 1/27/2023 2:38:17 AM
AssessmentDate :
Metadata :
SystemData :
Met deze opdracht worden maximaal 5 beleidsverklaringen opgehaald onder het abonnement met id d1acb22b-c876-44f7-b08e-3fcf9f6767f4. Alleen beleidsverklaringen voor de opgegeven beleidstoewijzing worden opgehaald.
Parameters
-DefaultProfile
De referenties, accounts, tenants en abonnementen die worden gebruikt voor communicatie met Azure.
Type: | IAzureContextContainer |
Aliassen: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Filter
Filterexpressie met behulp van OData-notatie.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Name
Resourcenaam.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-ResourceGroupName
Naam van de resourcegroep.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-ResourceId
Resource-id.
Type: | String |
Aliassen: | Id |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-Scope
Bereik van de resource. Bijvoorbeeld /subscriptions/{subscriptionId}/resourceGroups/{rgName}.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-Top
Maximum aantal records dat moet worden geretourneerd. Als dit niet wordt opgegeven, wordt het maximum aantal geretourneerde records bepaald door de Azure Policy-service (momenteel 1000).
Type: | Int32 |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |