Windows-Server-2008

如何使用命令行配置 DFS 複製?

  • April 14, 2014

我正在為下週的考試製作一個腳本來自動創建和複製 DFS。

所以,假設我有一個命名空間:

dfsutil root adddom \\Foo\bar 'My namespace'

我有一個連結:

dfsutil link add \\Foo\Bar\CoolStuff \\Server2\CoolStuff 'Neat stuff'

我如何使用命令行來複製\\Server2\CoolStuff,比如說,\\Server3\CoolStuff?當我使用dfscmd

dfscmd /add \\Foo\Bar\CoolStuff \\Server3\CoolStuff

它說它正確結束,但打開 MMC 顯示 CoolStuff 沒有複製組。

謝謝!

我最終發現dfsradmin並使它工作。這個文章給了我我需要的東西(以下內容僅供參考,以防網站出現故障;當然我不得不更改名稱):

# Add the namespace server
dfsutil /AddFTRoot /Server:%SERVER% /Share:SharedData

# Add Folder Targets from said server
dfscmd /add \\domain\SharedData\%SITE%\users$ \\%SERVER%\users$

# Add Folder Targets from Hub Server
dfscmd /add \\domain\SharedData\%SITE%\users$ \\HubServer\SharedData\%SITE%\users$

# Add Replication Group Info as per DFSRAdmin.doc
dfsradmin RG New /rgname:"%SERVER% Data$" /rgdesc:"%SERVER% Data$ DFS Replication Link"
dfsrAdmin RG Set Schedule full /RGName:"%SERVER% Data$"
dfsradmin member new /rgname:"%SERVER% Data$" /memname:HubServer
dfsradmin member new /rgname:"%SERVER% Data$" /memname:%SERVER%
dfsradmin conn new /rgname:"%SERVER% Data$" /SendMem:HubServer /RecvMem:%SERVER% /ConnEnabled:true /ConnKeywords:"From HubServer TO %SERVER%"
dfsradmin conn new /rgname:"%SERVER% Data$" /SendMem:%SERVER% /RecvMem:HubServer /ConnEnabled:true /ConnKeywords:"%SERVER% TO HubServer"
dfsradmin RF New /rgName:"%SERVER% Data$" /RfName:Data$ /RfDfsPath:"namespace\folder\path"
dfsradmin Membership Set /RgName:"%SERVER% Data$" /RfName:Data$ /MemName:HubServer /LocalPath:D:\DFS_ROOT\SharedData\%SITE%\Data$ /MembershipEnabled:true /StagingSize:1000 /CDSize:350 /IsPrimary:true
dfsradmin Membership Set /RgName:"%SERVER% Data$" /RfName:Data$ /MemName:%SERVER% /LocalPath:D:\Data$ /MembershipEnabled:true /StagingSize:1000 /CDSize:350 /IsPrimary:false

引用自:https://serverfault.com/questions/142044