Como eu configuro a replicação DFS usando a linha de comando?

2

Estou no processo de criar um script para automatizar a criação e a replicação de DFS para um exame que tenho na próxima semana.

Então, supondo que eu tenha um namespace:

dfsutil root adddom \Foo\bar 'My namespace'

E eu tenho um link:

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

Como posso usar a linha de comando para replicar \Server2\CoolStuff , digamos, \Server3\CoolStuff ? Quando eu uso dfscmd :

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

Diz que terminou corretamente, mas abrir o MMC mostra que não há grupos de replicação para o CoolStuff.

Obrigado!

    
por zneak 14.05.2010 / 23:36

2 respostas

4

Acabei descobrindo sobre dfsradmin e fiz o trabalho funcionar. Este tópico me deu o que eu precisava (o seguinte é fornecido como uma referência no caso do site cair, é claro que eu tive que mudar os nomes):

# 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
    
por 15.05.2010 / 01:24
1

A seguir, o Batch replica entre dois servidores e torna o destino somente para leitura (para usuários).

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
    
por 14.04.2014 / 10:34