匯入安全性設定 (.inf 檔案),先前從以安全性範本設定的資料庫匯出。
Important
將 .inf 檔案匯入另一部計算機之前,您必須在執行匯入的資料庫上執行 secedit /generaterollback
命令。
您也必須在匯入檔案上執行 secedit /validate
命令,以確認其完整性。
Syntax
secedit /import /db <database file name> /cfg <configuration file name> [/overwrite] [/areas [securitypolicy | group_mgmt | user_rights | regkeys | filestore | services]] [/log <log file name>] [/quiet]
Parameters
Parameter | Description |
---|---|
/db | Required. 指定包含執行匯入之預存組態的資料庫路徑和檔名。 如果檔名指定的資料庫沒有相關聯的安全性範本(如組態檔所代表),則也必須指定 /cfg <configuration file name> 選項。 |
/overwrite | Specifies whether the security template in the /cfg parameter should overwrite any template or composite template that is stored in the database, instead of appending the results to the stored template. 只有在也使用 /cfg <configuration file name> 參數時,此選項才有效。 If this parameter isn't also specified, the template in the /cfg parameter is appended to the stored template. |
/cfg | Required. 指定將匯入資料庫以供分析之安全性範本的路徑和檔名。 此選項只有在搭配 /db <database file name> 參數使用時才有效。 如果未同時指定此參數,則會針對已儲存在資料庫中的任何組態執行分析。 |
/areas | 指定要套用至系統的安全性區域。 如果未指定此參數,資料庫中定義的所有安全性設定都會套用至系統。 若要設定多個區域,請以空格分隔每個區域。 支援下列安全性區域:
|
/log | 指定要用於進程之記錄檔的路徑和檔名。 如果您未指定檔案位置,則會使用預設記錄檔 <systemroot>\Documents and Settings\<UserAccount>\My Documents\Security\Logs\<databasename>.log 。 |
/quiet | 隱藏畫面和記錄輸出。 您仍然可以使用安全性設定和分析嵌入式管理單元來檢視分析結果Microsoft管理控制台 (MMC)。 |
Examples
若要將安全性資料庫和網域安全策略導出至 .inf 檔案,然後將該檔案匯入不同的資料庫,以復寫另一部計算機上的原則設定,請輸入:
secedit /export /db C:\Security\FY11\SecDbContoso.sdb /mergedpolicy /cfg NetworkShare\Policies\SecContoso.inf /log C:\Security\FY11\SecAnalysisContosoFY11.log /quiet
若要將檔案的安全策略部分只匯入另一部電腦上的不同資料庫,請輸入:
secedit /import /db C:\Security\FY12\SecDbContoso.sdb /cfg NetworkShare\Policies\SecContoso.inf /areas securitypolicy /log C:\Security\FY11\SecAnalysisContosoFY12.log /quiet