Get-SqlSensitivityRecommendations
取得資料庫中資料行的建議敏感度標籤和資訊類型。
Syntax
Get-SqlSensitivityRecommendations
[-SuppressProviderContextWarning]
[<CommonParameters>]
Get-SqlSensitivityRecommendations
-ConnectionString <String>
[<CommonParameters>]
Get-SqlSensitivityRecommendations
-ServerInstance <PSObject>
-DatabaseName <String>
[-Credential <PSCredential>]
[<CommonParameters>]
Get-SqlSensitivityRecommendations
-Path <String>
[<CommonParameters>]
Get-SqlSensitivityRecommendations
-InputObject <Database>
[<CommonParameters>]
Description
Get-SqlSensitivityRecommendations取得資料庫中資料行的建議敏感度標籤和資訊類型。 Cmdlet 不會傳回已經定義敏感度標籤或資訊類型的資料行值。
您可以使用SQL Server Management Studio (SSMS) 17.5 版和更新版本、擴充屬性目錄檢視或Get-SqlSensitivityClassification Cmdlet 來檢視資料行的敏感度標籤和資訊類型。
您可以使用SQL Server Management Studio (SSMS) 17.5 版和更新版本,或使用 Set-SqlSensitivityClassification Cmdlet 來設定資料行的敏感度標籤和資訊類型。
Module requirements: version 21+ on PowerShell 5.1; version 22+ on PowerShell 7.x.
範例
範例 1:使用 Windows 驗證 取得資料庫的資訊類型和敏感度標籤建議
PS C:\> Get-SqlSensitivityRecommendations -ServerInstance "MyComputer\MainInstance" -Database "myDatabase"
Column InformationType SensitivityLabel SensitivityRank
------ --------------- ---------------- ---------------
Sales.Customers.email Contact Info Confidential Medium
Sales.Customers.first_name Name Confidential - GDPR Medium
Sales.Customers.ip_address Networking Confidential Medium
Sales.Customers.last_name Name Confidential - GDPR Medium
Sales.Orders.AccountNumber Financial Confidential Medium
Sales.Orders.CreditCardApprovalCode Credit Card Confidential Medium
Sales.Orders.CreditCardID Credit Card Confidential Medium
Sales.Orders.CurrencyRateID Financial Confidential Medium
取得 中 myDatabase
資料行的建議資訊類型和敏感度標籤。 Cmdlet 會傳回分類演算法能夠比對資料行與資訊類型的資料行。 此 Cmdlet 不會傳回已經具有資訊類型或敏感度標籤的資料行。
參數
-ConnectionString
指定要連線至資料庫的連接字串。 如果存在此參數,將會忽略其他連接參數
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Credential
指定用來連線到資料庫的認證。
Type: | PSCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DatabaseName
指定資料庫的名稱。 此 Cmdlet 會連接到 ServerInstance 參數中指定的實例中的這個資料庫。
如果未指定 DatabaseName 參數,則所使用的資料庫取決於目前路徑是否同時指定 SQLSERVER:\SQL 資料夾和資料庫名稱。 如果路徑同時指定 SQL 資料夾和資料庫名稱,此 Cmdlet 會連線到路徑中指定的資料庫。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
指定SQL Server管理物件 (SMO) ,代表此 Cmdlet 所使用的資料庫。
Type: | Database |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Path
指定此 Cmdlet 執行作業之SQL Server實例的路徑。 如果您未指定此參數的值,Cmdlet 會使用目前的工作位置。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ServerInstance
指定伺服器實例的名稱 (字串) 或SQL Server管理物件 (SMO) 物件,指定 Database Engine 實例的名稱。 針對預設實例,只指定電腦名稱稱:MyComputer。 針對具名實例,請使用 ComputerName\InstanceName 格式。
Type: | PSObject |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SuppressProviderContextWarning
指出此 Cmdlet 會隱藏此 Cmdlet 在目前 SQLSERVER:\SQL 路徑設定的資料庫內容中使用的警告,以建立 Cmdlet 的資料庫內容。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸入
Microsoft.SqlServer.Management.Smo.Database
輸出
System.Object