web-dev-qa-db-ja.com

コマンドラインを使用してDFSレプリケーションを構成するにはどうすればよいですか?

来週の試験のために、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のレプリケーショングループがないことがわかります。

ありがとう!

2
zneak

私は結局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
4
zneak

次のバッチは2つのサーバー間で複製され、宛先を読み取り専用にします(ユーザーの場合)。

SET DFSR_GROUP_NAME=Server1toServer2
SET SOURCE_SERVER=SERVER1NAME
SET SOURCE_PATH=D:\
SET DESTINATION_SERVER=SERVER2NAME
SET DESTINATION_PATH=D:\SERVER2BACKUP\D
SET SCHEDULE=full
REM **** BELOW DO NOT EDIT ***
@echo off
cls
echo Erstelle DFS Replikation zwischen %SOURCE_SERVER% und %DESTINATION_SERVER%
echo.
pause
cls
echo Bitte Warten...
echo.
ping 127.0.0.1 -n 3 > NUL
dfsradmin RG New /rgname:"%DFSR_GROUP_NAME%"
dfsrAdmin RG Set Schedule full /RGName:"%DFSR_GROUP_NAME%"
dfsradmin member new /rgname:"%DFSR_GROUP_NAME%" /memname:%SOURCE_SERVER%
dfsradmin member new /rgname:"%DFSR_GROUP_NAME%" /memname:%DESTINATION_SERVER%
dfsradmin conn new /rgname:"%DFSR_GROUP_NAME%" /SendMem:%SOURCE_SERVER% /RecvMem:%
DESTINATION_SERVER% /ConnEnabled:true
dfsradmin conn new /rgname:"%DFSR_GROUP_NAME%" /SendMem:%DESTINATION_SERVER% /RecvMem:%SOURCE_SERVER% /ConnEnabled:true
dfsradmin RF New /rgName:"%DFSR_GROUP_NAME%" /RfName:DFS_SYNC
dfsradmin Membership Set /RgName:"%DFSR_GROUP_NAME%" /RfName:DFS_SYNC /MemName:%SOURCE_SERVER% /LocalPath:%SOURCE_PATH% /MembershipEnabled:true /IsPrimary:true
dfsradmin Membership Set /RgName:"%DFSR_GROUP_NAME%" /RfName:DFS_SYNC /MemName:%DESTINATION_SERVER% /LocalPath:%DESTINATION_PATH% /MembershipEnabled:true /RO:True /IsPrimary:false

REM Defines the value for each 15 min-interval in sets of 4, 
REM where each set represents one hour x 24 hours, where 0=off and f=on, 
REM and numbers represent bandwidth throttling (for example, 1=64kbps, 2=128kbps, and so on)

echo Warte 2 Minuten...

ping 127.0.0.1 -n 120 > NUL

echo Erstelle Replikationszeitraum...

dfsradmin RG Set Sched Custom /RgName:%DFSR_GROUP_NAME% /Day:Monday /Schedule:3333,3333,3333,3333,2222,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,2222,3333,3333,3333
dfsradmin RG Set Sched Custom /RgName:%DFSR_GROUP_NAME% /Day:Tuesday /Schedule:3333,3333,3333,3333,2222,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,2222,3333,3333,3333
dfsradmin RG Set Sched Custom /RgName:%DFSR_GROUP_NAME% /Day:Wednesday /Schedule:3333,3333,3333,3333,2222,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,2222,3333,3333,3333
dfsradmin RG Set Sched Custom /RgName:%DFSR_GROUP_NAME% /Day:Thursday /Schedule:3333,3333,3333,3333,2222,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,2222,3333,3333,3333
dfsradmin RG Set Sched Custom /RgName:%DFSR_GROUP_NAME% /Day:Friday /Schedule:3333,3333,3333,3333,2222,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,2222,3333,3333,3333
dfsradmin RG Set Sched Custom /RgName:%DFSR_GROUP_NAME% /Day:Saturday /Schedule:3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333
dfsradmin RG Set Sched Custom /RgName:%DFSR_GROUP_NAME% /Day:Sunday /Schedule:3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333,3333
pause

exit
1
therealredzac