Get-AzSqlDatabaseAudit
取得 Azure SQL 資料庫的稽核設定。
語法
Get-AzSqlDatabaseAudit
[-ResourceGroupName] <String>
[-ServerName] <String>
[-DatabaseName] <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzSqlDatabaseAudit
-DatabaseObject <AzureSqlDatabaseModel>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Get-AzSqlDatabaseAudit Cmdlet 會取得 Azure SQL 資料庫的稽核設定。 若要使用 Cmdlet,請使用 ResourceGroupName、ServerName和 DatabaseName 參數來識別資料庫。
範例
範例 1:取得 Azure SQL 資料庫的稽核設定
Get-AzSqlDatabaseAudit -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01"
ServerName : server01
DatabaseName : database01
AuditAction : {}
ResourceGroupName : resourcegroup01
AuditActionGroup : {SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP,
BATCH_COMPLETED_GROUP, ...}
PredicateExpression : statement <> 'select 1'
BlobStorageTargetState : Enabled
StorageAccountResourceId : /subscriptions/7fe3301d-31d3-4668-af5e-211a890ba6e3/resourceGroups/resourcegroup01/providers/Microsoft.Storage/storageAccounts/mystorage
StorageKeyType : Primary
RetentionInDays : 0
EventHubTargetState : Enabled
EventHubName : eventHubName
EventHubAuthorizationRuleResourceId : EventHubAuthorizationRuleResourceId
LogAnalyticsTargetState : Enabled
WorkspaceResourceId : "/subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2"
範例 2:透過管線取得 Azure SQL 資料庫的稽核設定
Get-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01" | Get-AzSqlDatabaseAudit
ServerName : server01
DatabaseName : database01
AuditAction : {}
ResourceGroupName : resourcegroup01
AuditActionGroup : {SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP,
BATCH_COMPLETED_GROUP, ...}
PredicateExpression : statement <> 'select 1'
BlobStorageTargetState : Enabled
StorageAccountResourceId : /subscriptions/7fe3301d-31d3-4668-af5e-211a890ba6e3/resourceGroups/resourcegroup01/providers/Microsoft.Storage/storageAccounts/mystorage
StorageKeyType : Primary
RetentionInDays : 0
EventHubTargetState : Enabled
EventHubName : eventHubName
EventHubAuthorizationRuleResourceId : EventHubAuthorizationRuleResourceId
LogAnalyticsTargetState : Enabled
WorkspaceResourceId : "/subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2"
範例 3:取得 Azure SQL 資料庫的稽核設定
Get-AzSqlDatabaseAudit -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01"
ServerName : server01
DatabaseName : database01
AuditAction : {}
ResourceGroupName : resourcegroup01
AuditActionGroup : {SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP,
BATCH_COMPLETED_GROUP, ...}
PredicateExpression : statement <> 'select 1'
BlobStorageTargetState : Enabled
StorageAccountResourceId : /subscriptions/7fe3301d-31d3-4668-af5e-211a890ba6e3/resourceGroups/resourcegroup01/providers/Microsoft.Storage/storageAccounts/mystorage
StorageKeyType : Primary
RetentionInDays : 0
EventHubTargetState : Enabled
EventHubName : eventHubName
EventHubAuthorizationRuleResourceId : EventHubAuthorizationRuleResourceId
LogAnalyticsTargetState : Disabled
WorkspaceResourceId :
參數
-DatabaseName
SQL Database 名稱。
類型: | String |
Position: | 2 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-DatabaseObject
管理其審核策略的資料庫物件。
類型: | AzureSqlDatabaseModel |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceGroupName
資源群組的名稱。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ServerName
SQL 伺服器名稱。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |