robocopy.exe "\\dimsrv01\c$\fserver" "C:\fserver" /e /b /copyall /r:6 /w:5 /MT:64 /xd DfsrPrivate /tee /log:c:\preseed-dfs.tmp.log
ΣΗΜΑΝΤΙΚΟ: το /e ΔΕΝ ΣΒΗΝΕΙ ΕΞΤΡΑ ΑΡΧΕΙΑ ΑΠΟ ΤΟ destination ενώ το /mir σβήνει
After robocopy check a few random files — you should get the same hash:
dfsrdiag filehash /path:"c:\fserver\x\y\z" dfsrdiag filehash /path:"\\dimsrv01\c$\fserver\x\y\z"
echo "Queued Kalamata -> Meg/poli" ; Get-DfsrBacklog -GroupName RGfserver -FolderName * -SourceComputerName dimsrv02 -DestinationComputerName dimsrv01 -verbose | ft FullPathName ; echo "Queued Meg/poli -> Kalamata" ; Get-DfsrBacklog -GroupName RGfserver -FolderName * -SourceComputerName dimsrv01 -DestinationComputerName dimsrv02 -verbose | ft FullPathName Queued Kalamata -> Meg/poli VERBOSE: No backlog for the replicated folder named "fserver" Queued Meg/poli -> Kalamata VERBOSE: The replicated folder has a backlog of files. Replicated folder: "fserver". Count: 1 FullPathName ------------ C:\fserver\accounting\DIMITRIOS\ΛΟΓΙΣΤΗΡΙΟ\ΠΑΡΟΥΣΙΕΣ ΔΕΗ\2017\IOYLIOS\10-7-2017.xlsx
Repadmin /syncall /Pe dc_name naming_contextWith Repadmin we get a much more specific error:
Repadmin /replsummary *
Repadmin /showrepl *
@echo off
echo. echo Gathering Report for DCLIST = %1 echo. Echo Report for DCLIST = %1 > replreport.txt echo. >> replreport.txt echo. >> replreport.txt echo Gathering Verbose Replication and Connections echo Verbose Replication and Connections >> replreport.txt echo. >> replreport.txt repadmin /showrepl %1 /all >> replreport.txt echo. >> replreport.txt echo Gathering Bridgeheads echo Bridgeheads >> replreport.txt echo. >> replreport.txt repadmin /bridgeheads %1 /verbose >> replreport.txt echo. >> replreport.txt echo Gathering ISTG echo ISTG >> replreport.txt echo. >> replreport.txt repadmin /istg %1 >> replreport.txt echo. >> replreport.txt echo Gathering DRS Calls echo Outbound DRS Calls >> replreport.txt echo. >> replreport.txt repadmin /showoutcalls %1 >> replreport.txt echo. >> replreport.txt echo Gathering Queue echo Queue >> replreport.txt echo. >> replreport.txt repadmin /queue %1 >> replreport.txt echo. >> replreport.txt echo Gathering KCC Failures echo KCC Failures >> replreport.txt echo. >> replreport.txt repadmin /failcache %1 >> replreport.txt echo. >> replreport.txt echo Gathering Trusts echo Trusts >> replreport.txt echo. >> replreport.txt repadmin /showtrust %1 >> replreport.txt echo. >> replreport.txt echo Gathering Replication Flags echo Replication Flags >> replreport.txt echo. >> replreport.txt repadmin /bind %1 >> replreport.txt echo. >> replreport.txt echo Done. |
Replreport.cmd server1Or to get data from all DC’s (which Replmon cannot do):
Replreport.cmd *Or to get data from all servers that have names starting with “SANFRAN“:
Replreport.cmd sanfran*It will output to a text file called replreport.txt. Anything Repadmin can do, you can do in this batch file. More More More Repadmin can do even more for monitoring. Such as: Tell you the last time your DCs were backed up, by reading the DSASignature attribute from all servers:
Repadmin /showbackup *
Repadmin /showrepl * /csv
Repadmin /queue *
repadmin /showchanges destination_DC source_DSA_GUID domain_DN
(69) add CN=Ned Pyle,CN=Users,DC=adatum,DC=comNeat right? That’s a user I created while the other DC was offline, in the list of pending changes. I snipped out another long list of changes that were also pending. Pretty useful to see if a DC that has not been replicating for a while is worth spending time trying to fix or is better off demoting. Other Repadmin capabilities Repadmin has plenty of other secrets you can use for monitoring, administering, and troubleshooting – most of which Replmon cannot do:
1> parentGUID: a90a9633-2682-4896-be86-21220cf24f0c
1> objectGUID: e8f0e0a2-69aa-4e4e-9f74-3db79ad6f3b7
4> objectClass: top; person; organizationalPerson; user
1> sn: Pyle
1> givenName: Ned
1> instanceType: 0x4 = ( WRITE )
1> whenCreated: 6/21/2009 9:05:32 AM Pacific Daylight Time
1> displayName: Ned Pyle
1> nTSecurityDescriptor: O:DAG:DAD:AI
1> name: Ned Pyle
1> userAccountControl: 0x10200 = ( NORMAL_ACCOUNT | DONT_EXPIRE_PASSWD )
1> codePage: 0
1> countryCode: 0
1> pwdLastSet: 6/21/2009 9:05:32 AM Pacific Daylight Time
1> primaryGroupID: 513 = ( GROUP_RID_USERS )
1> objectSid: S-1-5-21-3776065869-1984782319-1196103478-1107
1> accountExpires: (never)
1> sAMAccountName: nedpyle
1> sAMAccountType: 805306368 = ( NORMAL_USER_ACCOUNT )
1> userPrincipalName: nedpyle@adatum.com
1> objectCategory: <GUID=4ed8da23575bed48b12cd36061257c14>;CN=Person,CN=Schema,CN=Configuration,DC=adatum,DC=com
repadmin /showrepl
Repadmin: running command /showrepl against full DC localhost Default-First-Site-Name\DIMSRV02 DSA Options: IS_GC Site Options: (none) DSA object GUID: 8a621083-6491-4717-8fc3-560828ccce7b DSA invocationID: 98eeedbd-26a7-43b3-b19b-d5f400ac5d8d ==== INBOUND NEIGHBORS ====================================== DC=dimopoulos,DC=local Default-First-Site-Name\DIMSRV01 via RPC DSA object GUID: 97429870-812d-4d79-ad25-b99b6fdd32dc Last attempt @ 2017-06-18 18:02:49 wassuccessful
.
CN=Configuration,DC=dimopoulos,DC=localLast attempt @ 2017-06-18 17:49:54 was
successful .
CN=Schema,CN=Configuration,DC=dimopoulos,DC=localLast attempt @ 2017-06-18 17:49:54 was
successful .
DC=DomainDnsZones,DC=dimopoulos,DC=localLast attempt @ 2017-06-18 17:49:54 was
successful .
DC=ForestDnsZones,DC=dimopoulos,DC=localLast attempt @ 2017-06-18 17:49:54 was
successful .
step 0c) Test for DNS problemsnotepad c:\dns-test-log.temp.txt
:: take a good look at the resultsStep 0d) Check if you can find the DC for the domain.
NLTEST /DSGETDC:dimopoulos
The command completed successfullyStep1) findout from which DC we get the DFS configuration:
WMIC /namespace:\\root\microsoftdfs path DfsrReplicationGroupConfig get LastChangeSource
LastChangeSource DIMSRV02.dimopoulos.localStep 2) replicate the AD config from the other DC
dimsrv02 <----
dimsrv01 [I THINK THIS WORKED] after running it I show the replication settings for fserver appear in DFS Managerrepadmin /replicate /force dimsrv02 dimsrv01 "DC=dimopoulos,DC=local"
Sync from dimsrv01 to dimsrv02 completed successfully.The command to force replication to start
dfsrdiag syncnow /partner:dimsrv01 /RGName:"Domain System Volume" /Time:60
Operation Succeeded
REPADMIN /REPLSUM * /BYSRC /BYDEST /SORT:ERROR
Replication Summary Start Time: 2017-06-18 20:12:11 Beginning data collection for replication summary, this may take awhile: Source DSA largest delta fails/total %% error DIMSRV01 04m:32s 0 / 5 0 DIMSRV02 04m:26s 0 / 5 0 Destination DSA largest delta fails/total %% error DIMSRV01 04m:26s 0 / 5 0 DIMSRV02 04m:32s 0 / 5 0
psexec -i -s cmd.exe
# PHASE 1 Move DFSR synced folder from one drive to another ################################################################################################### # Deleted DFSR settings related to C:\fserver #--------------------------------------------- PS C:\Users\Administrator> Remove-DfsrMember -GroupName "RG01" -ComputerName DIMSRV01 This operation will remove the computer and all of its memberships and connections. Computer: DIMSRV01 Replication group: "RG01" Are you sure you want to remove this computer from its replication group and all of its memberships and connections? [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y PS C:\Users\Administrator> Remove-DfsReplicatedFolder -GroupName "RG01" -FolderName "RFfserver" This operation will remove the replicated folder "RFfserver" and its memberships. Are you sure you want to remove this replicated folder and its memberships? [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y PS C:\Users\Administrator> Remove-DfsReplicationGroup -GroupName "RG01" This operation will remove the replication group "RG01" and the subscriptions members have to this replication group. Are you sure you want to remove this replication group? [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y PS C:\Users\Administrator> Update-DfsrConfigurationFromAD ?ComputerName DIMSRV01 -verbose VERBOSE: Performing the operation "Update-DfsrConfigurationFromAD" on target "DIMSRV01". VERBOSE: Successfully updated the DFSR Active Directory Domain Service configuration on the computer named DIMSRV01 # Recreated DFSR for K:\fserver #--------------------------------------------- New-DfsReplicationGroup -GroupName "RGfserver" New-DfsReplicatedFolder -GroupName "RGfserver" -FolderName "RFfserver" Add-DfsrMember -GroupName "RGfserver" -ComputerName DIMSRV01 Set-DfsrMembership -GroupName "RGfserver" -FolderName "RFfserver" -ContentPath "K:\fserver" -ComputerName DIMSRV01 -PrimaryMember $True Update-DfsrConfigurationFromAD –ComputerName DIMSRV01 -verbose # PHASE 2 use robocopy for fast syncing and then start normal DFSR replication ################################################################################################### # export DFS-R db New-Item -Path "K:\Dfsrclone" -Type Directory Export-DfsrClone -Volume K: -Path "K:\Dfsrclone" # monitor (it'll take time) Get-WinEvent "Dfs replication" MaxEvents 4 | fl # pressed with robocopy (initial fast sync) robocopy K:\fserver \\DIMSRV02\k$\fserver /E /B /COPYALL /R:6 /W:5 /MT:64 /XD DfsrPrivate /LOG+:K:\preseed.log # copy exported DFSR db Robocopy.exe "K:\Dfsrclone" \\DIMSRV02\k$\Dfsrclone /B # test a few files Get-DfsrFileHash '\\DIMSRV01\K$\fserver\it-public\*' Get-DfsrFileHash '\\DIMSRV01\K$\fserver\it-public\drivers\*' ... # establish normal DFSR replication Add-DfsrMember -GroupName "RGfserver" -ComputerName DIMSRV02 Add-DfsrConnection -GroupName "RGfserver" -SourceComputerName DIMSRV01 -DestinationComputerName DIMSRV02 Set-DfsrMembership -GroupName "RGfserver" -FolderName "RFfserver" -ComputerName DIMSRV02 -ContentPath "K:\RGfserver" Update-DfsrConfigurationFromAD DIMSRV01,DIMSRV02 #undo BY DELETING CONNECTION K:\RGfserver on DIMSRV02 #4010 Add-DfsrMember -GroupName "RGfserver" -ComputerName DIMSRV02 Add-DfsrConnection -GroupName "RGfserver" -SourceComputerName DIMSRV01 -DestinationComputerName DIMSRV02 Set-DfsrMembership -GroupName "RGfserver" -FolderName "RFfserver" -ComputerName DIMSRV02 -ContentPath "K:\fserver" # Wait for the DFSR informational event 4104 #............................................ Get-WinEvent "Dfs replication" -MaxEvents 3 | fl