Aracılığıyla paylaş


Get-AzPolicyAttestation

İlke kanıtlamalarını alır.

Sözdizimi

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

Get-AzPolicyAttestation cmdlet'i bir kapsamdaki veya belirli bir kanıtlamadaki tüm ilke kanıtlamalarını alır.

Örnekler

Örnek 1: Geçerli abonelikteki tüm ilke kanıtlamalarını alma

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                  :

Bu komut, d1acb22b-c876-44f7-b08e-3fcf9f6767f4 kimliğine sahip bir aboneliğin içinde veya altında oluşturulan tüm kanıtlamaları alır.

Örnek 2: Belirli bir ilke kanıtlamasını alma

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                  :

Bu komut , 'ps-attestation-test-rg' kaynak grubunda 'attestation-RG' adlı kanıtlamayı alır.

Örnek 3: İsteğe bağlı filtreler içeren bir abonelikte 5 ilke kanıtlaması alma

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                  :

Bu komut, d1acb22b-c876-44f7-b08e-3fcf9f6767f4 kimliğine sahip aboneliğin altında en fazla 5 ilke kanıtlaması alır. Yalnızca belirtilen ilke ataması için ilke kanıtlamaları alınır.

Parametreler

-DefaultProfile

Azure ile iletişim için kullanılan kimlik bilgileri, hesap, kiracı ve abonelik.

Tür:IAzureContextContainer
Diğer adlar:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Gerekli:False
İşlem hattı girişini kabul et:False
Joker karakterleri kabul et:False

-Filter

OData gösterimini kullanarak ifadeyi filtreleyin.

Tür:String
Position:Named
Default value:None
Gerekli:False
İşlem hattı girişini kabul et:False
Joker karakterleri kabul et:False

-Name

Kaynak adı.

Tür:String
Position:Named
Default value:None
Gerekli:True
İşlem hattı girişini kabul et:True
Joker karakterleri kabul et:False

-ResourceGroupName

Kaynak grubu adı.

Tür:String
Position:Named
Default value:None
Gerekli:True
İşlem hattı girişini kabul et:True
Joker karakterleri kabul et:False

-ResourceId

Kaynak Kimliği.

Tür:String
Diğer adlar:Id
Position:Named
Default value:None
Gerekli:True
İşlem hattı girişini kabul et:True
Joker karakterleri kabul et:False

-Scope

Kaynağın kapsamı. Örneğin, '/subscriptions/{subscriptionId}/resourceGroups/{rgName}'.

Tür:String
Position:Named
Default value:None
Gerekli:True
İşlem hattı girişini kabul et:True
Joker karakterleri kabul et:False

-Top

Döndürülecek en fazla kayıt sayısı. Sağlanmadıysa, döndürülen en fazla kayıt sayısı Azure İlkesi hizmeti tarafından belirlenir (şu anda 1000).

Tür:Int32
Position:Named
Default value:None
Gerekli:False
İşlem hattı girişini kabul et:False
Joker karakterleri kabul et:False

Girişler

String

Çıkışlar

PSAttestation