匯出儲存在以安全性範本設定之資料庫中的安全性設定。 除了將設定匯入另一部計算機之外,您也可以使用此命令在本機計算機上備份安全策略。
Syntax
secedit /export [/db <database file name>] [/mergedpolicy] /cfg <configuration file name> [/areas [securitypolicy | group_mgmt | user_rights | regkeys | filestore | services]] [/log <log file name>] [/quiet]
Parameters
Parameter | Description |
---|---|
/db | 您必須在匯出至預設以外的位置時,指定包含預存組態之資料庫的路徑和檔名。 If not specified, the system security database will be stored in %windir%\security\database. 如果檔名指定的資料庫沒有相關聯的安全性範本(如組態檔所代表),則也必須為匯出指定 /cfg <configuration file name> 選項。 |
/mergedpolicy | 合併和匯出網域和本機原則安全性設定。 |
/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 SecContoso.inf /log C:\Security\FY11\SecAnalysisContosoFY11.log /quiet
若要將範例檔案匯入另一部電腦上的不同資料庫,請輸入:
secedit /import /db C:\Security\FY12\SecDbContoso.sdb /cfg SecContoso.inf /log C:\Security\FY11\SecAnalysisContosoFY12.log /quiet