Microsoft's official enterprise support blog for AD DS and more
Hi all, Ned here again. There are a number of ways that DFSR can be tuned for better performance. This article will go through these configurations and explain the caveats. Even if you cannot deploy Windows Server 2008 R2 - for the absolute best performance - you can at least remove common bottlenecks from your older environments. If you are really serious about performance in higher node count DFSR environments though, Win2008 R2’s 3rd generation DFSR is the answer.
If you’ve been following DFSR for the past few years, you already know about some improvements that were made to performance and scalability starting in Windows Server 2008:
Windows Server 2003 R2
Windows Server 2008
Multiple RPC calls
RPC Async Pipes (when replicating with other servers running Windows Server 2008)
Synchronous inputs/outputs (I/Os)
Asynchronous I/Os
Buffered I/Os
Unbuffered I/Os
Normal Priority I/Os
Low Priority I/Os (this reduces the load on the system as a result of replication)
4 concurrent file downloads
16 concurrent file downloads
But there’s more you can do, especially in 2008 R2.
All registry values are REG_DWORD (and in the explanations below, are always in decimal). All registry tuning for DFSR in Win2008 and Win2008 R2 is made here:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DFSR\Parameters\Settings
A restart of the DFSR service is required for the settings to take effect, but a reboot is not required. The list below is not complete, but instead covers the important values for performance. Do not assume that setting a value to the max will make it faster; some settings have a practical limitation before other bottlenecks make higher values irrelevant.
Important Note: None of these registry settings apply to Windows Server 2003 R2.
AsyncIoMaxBufferSizeBytes Default value: 2097152 Possible values: 1048576, 2097152, 4194304, 8388608 Tested high performance value: 8388608 Set on: All DFSR nodes RpcFileBufferSize Default value: 262144 Possible values: 262144, 524288 Tested high performance value: 524288 Set on: All DFSR nodes StagingThreadCount Default value: 6 (Win2008 R2 only; cannot be changed on Win2008) Possible values: 4-16 Tested high performance value: 8 Set on: All DFSR nodes. Setting to 16 may generate too much disk IO to be useful. TotalCreditsMaxCount Default value: 1024 Possible values: 256-4096 Tested high performance value: 4096 Set on: All DFSR nodes that are generally inbound replicating (so hubs if doing data collection, branches if doing data distribution, all servers if using no specific replication flow) UpdateWorkerThreadCount Default value: 16 Possible values (Win2008): 4-32 Possible values (Win2008 R2): 4-63* Tested high performance value: 32 Set on: All DFSR nodes that are generally inbound replicating (so hubs if doing data collection, branches if doing data distribution, all servers if using no specific replication flow. The number being raised here is only valuable when replicating in from more servers than the value. I.e. if replicating in 32 servers, set to 32. If replicating in 45 servers set to 45. *Important note: The actual top limit is 64. We have found that under certain circumstances though, setting to 64 can cause a deadlock that prevents DFSR replication altogether. If you exceed the maximum tested value of 32, set to 63 or lower. Do not set to 64 ever. The 32 max limit is recommended because we tested it carefully, and higher values were not rigorously tested. If you set this value to 64, periodically replication will stop working, the dfsrdiag replstate command hangs and does not return results, and the dfsrdiag backlog command hangs and does not return results.
AsyncIoMaxBufferSizeBytes Default value: 2097152 Possible values: 1048576, 2097152, 4194304, 8388608 Tested high performance value: 8388608 Set on: All DFSR nodes
RpcFileBufferSize Default value: 262144 Possible values: 262144, 524288 Tested high performance value: 524288 Set on: All DFSR nodes
StagingThreadCount Default value: 6 (Win2008 R2 only; cannot be changed on Win2008) Possible values: 4-16 Tested high performance value: 8 Set on: All DFSR nodes. Setting to 16 may generate too much disk IO to be useful.
TotalCreditsMaxCount Default value: 1024 Possible values: 256-4096 Tested high performance value: 4096 Set on: All DFSR nodes that are generally inbound replicating (so hubs if doing data collection, branches if doing data distribution, all servers if using no specific replication flow)
UpdateWorkerThreadCount Default value: 16 Possible values (Win2008): 4-32 Possible values (Win2008 R2): 4-63* Tested high performance value: 32
Set on: All DFSR nodes that are generally inbound replicating (so hubs if doing data collection, branches if doing data distribution, all servers if using no specific replication flow. The number being raised here is only valuable when replicating in from more servers than the value. I.e. if replicating in 32 servers, set to 32. If replicating in 45 servers set to 45.
*Important note: The actual top limit is 64. We have found that under certain circumstances though, setting to 64 can cause a deadlock that prevents DFSR replication altogether. If you exceed the maximum tested value of 32, set to 63 or lower. Do not set to 64 ever. The 32 max limit is recommended because we tested it carefully, and higher values were not rigorously tested. If you set this value to 64, periodically replication will stop working, the dfsrdiag replstate command hangs and does not return results, and the dfsrdiag backlog command hangs and does not return results.
When using all the above registry tuning on Windows Server 2008 R2, testing revealed that initial sync replication time was sometimes twice as fast compared to no registry settings in place. This was using 32 servers replicating a "data collection" topology to a single hub over thirty-two non-LAN networks with 32 RG's containing unique branch office data. The slower the network, the better the relative performance averaged:
Test
Spokes
Hubs
Topology
GB/node
Unique
RG
Tuned
Network
Time to sync
C1
32
1
Collect
Yes
N
1Gbps
0:57:27
C2
Y
0:53:09
C3
1.5Mbps
3:31:36
C4
2:24:09
C5
512Kbps
10:56:42
C6
5:57:09
C7
256Kbps
21:43:02
C8
10:46:46
On Windows Server 2008 the same registry values showed considerably less performance improvement; this is partly due to additional service improvements made to DFSR in Win2008 R2, especially around the Credit Manager. Just like your phone, “3G” DFSR is going to work better than older models…
Note: do not use this table to predict replication times. It is designed to show behavior trends only!
Even if you are not using Windows Server 2008 R2 there are plenty of other factors to fast replication. Some of these I’ve talked about before, some are new. All are important:
And this configuration would cause less bottlenecking:
This means that by default on Win2008/Win2008 R2, quota must be as large as the 32 largest files. If UpdateWorkerThreadCount is increased to 32, it must be as large as the 48 largest files (32+16). If any smaller then staging can become blocked when all 32 files are being replicated inbound and 16 outbound, preventing further replication until that queue is cleared. Frequent 4202 and 4204 staging events are indications of an inappropriately configured staging quota, especially if no longer in the initial sync phase of setting up DFSR for the first time. Source : DFSR Catagory : None Event ID : 4202 Type : Warning Description : The DFS Replication service has detected that the staging space in use for the replicated folder at local path c:\foo is above the high watermark. The service will attempt to delete the oldest staging files. Performance may be affected. Source : DFSR Catagory : None Event ID : 4204 Type : Information Description : The DFS Replication service has successfully deleted old staging files for the replicated folder at local path c:\foo. The staging space is now below the high watermark.
This means that by default on Win2008/Win2008 R2, quota must be as large as the 32 largest files. If UpdateWorkerThreadCount is increased to 32, it must be as large as the 48 largest files (32+16). If any smaller then staging can become blocked when all 32 files are being replicated inbound and 16 outbound, preventing further replication until that queue is cleared. Frequent 4202 and 4204 staging events are indications of an inappropriately configured staging quota, especially if no longer in the initial sync phase of setting up DFSR for the first time.
Source : DFSR Catagory : None Event ID : 4202 Type : Warning Description : The DFS Replication service has detected that the staging space in use for the replicated folder at local path c:\foo is above the high watermark. The service will attempt to delete the oldest staging files. Performance may be affected.
Source : DFSR Catagory : None Event ID : 4204 Type : Information Description : The DFS Replication service has successfully deleted old staging files for the replicated folder at local path c:\foo. The staging space is now below the high watermark.
If you get 4206 staging events you have really not correctly sized your staging, as you are now blocking replication behind large files. Event Type: Warning Event Source: DFSR Event Category: None Event ID: 4206 Date: 4/4/2009 Time: 3:57:21 PM User: N/A Computer: SRV Description: The DFS Replication service failed to clean up old staging files for the replicated folder at local path c:\foo. The service might fail to replicate some large files and the replicated folder might get out of sync. The service will automatically retry staging space cleanup in 1 minutes. The service may start cleanup earlier if it detects some staging files have been unlocked. If still using Win2003 R2, staging quota would need to be as large as the 9 largest files. And if using read-only replication on Windows Server 2008 R2, at least 16 or the size specified in UpdateWorkerThreadCount – after all, a read-only replicated folder has no outbound replication. So to recap the staging quota minimum recommendations: - Windows Server 2003 R2: 9 largest files - Windows Server 2008: 32 largest files (default registry) - Windows Server 2008 R2: 32 largest files (default registry) - Windows Server 2008 R2 Read-Only: 16 largest files If you want to find the 32 largest files in a replicated folder, here’s a sample PowerShell command: Get-ChildItem <replicatedfolderpath> -recurse | Sort-Object length -descending | select-object -first 32 | ft name,length -wrap –auto
If you get 4206 staging events you have really not correctly sized your staging, as you are now blocking replication behind large files.
Event Type: Warning Event Source: DFSR Event Category: None Event ID: 4206 Date: 4/4/2009 Time: 3:57:21 PM User: N/A Computer: SRV Description: The DFS Replication service failed to clean up old staging files for the replicated folder at local path c:\foo. The service might fail to replicate some large files and the replicated folder might get out of sync. The service will automatically retry staging space cleanup in 1 minutes. The service may start cleanup earlier if it detects some staging files have been unlocked.
If still using Win2003 R2, staging quota would need to be as large as the 9 largest files. And if using read-only replication on Windows Server 2008 R2, at least 16 or the size specified in UpdateWorkerThreadCount – after all, a read-only replicated folder has no outbound replication.
So to recap the staging quota minimum recommendations:
- Windows Server 2003 R2: 9 largest files - Windows Server 2008: 32 largest files (default registry) - Windows Server 2008 R2: 32 largest files (default registry) - Windows Server 2008 R2 Read-Only: 16 largest files
If you want to find the 32 largest files in a replicated folder, here’s a sample PowerShell command:
Get-ChildItem <replicatedfolderpath> -recurse | Sort-Object length -descending | select-object -first 32 | ft name,length -wrap –auto
Win2008 R2: http://www.bing.com/search?q=%22windows+server+2008+r2%22+%22dfsrs.exe%22+kbqfe+site%3Asupport.microsoft.com&go=&form=QBRE Win2008: http://www.bing.com/search?q=%22windows+server+2008%22+%22dfsrs.exe%22+kbqfe+site%3Asupport.microsoft.com&form=QBRE&qs=n Win2003 R2: http://www.bing.com/search?q=%22windows+server+2003+r2%22+%22dfsr.exe%22+kbqfe+site%3Asupport.microsoft.com&form=QBRE&qs=n Remember, Win2003 mainstream support ends July 13, 2010. That’s the end of non-security updates for that OS. People ask me all the time why I take such a hard line on DFSR hotfixes. I ask in return “Why don’t you take such a hard line?” These fixes cost us a fortune, we’re not writing them for our health. And that goes for all other components too, not just DFSR. It’s an issue intrinsic to all software. DFSR is not less reliable than many other Windows components – after all, NTFS is considered an extremely reliable file system but that hasn’t stopped it from having 168 hotfixes in its lifetime; DFSR just has a passionate group of Support Engineers and developers here at MS that want you to have the best experience.
Win2008 R2: http://www.bing.com/search?q=%22windows+server+2008+r2%22+%22dfsrs.exe%22+kbqfe+site%3Asupport.microsoft.com&go=&form=QBRE
Win2008: http://www.bing.com/search?q=%22windows+server+2008%22+%22dfsrs.exe%22+kbqfe+site%3Asupport.microsoft.com&form=QBRE&qs=n
Win2003 R2: http://www.bing.com/search?q=%22windows+server+2003+r2%22+%22dfsr.exe%22+kbqfe+site%3Asupport.microsoft.com&form=QBRE&qs=n
Remember, Win2003 mainstream support ends July 13, 2010. That’s the end of non-security updates for that OS.
People ask me all the time why I take such a hard line on DFSR hotfixes. I ask in return “Why don’t you take such a hard line?” These fixes cost us a fortune, we’re not writing them for our health. And that goes for all other components too, not just DFSR. It’s an issue intrinsic to all software. DFSR is not less reliable than many other Windows components – after all, NTFS is considered an extremely reliable file system but that hasn’t stopped it from having 168 hotfixes in its lifetime; DFSR just has a passionate group of Support Engineers and developers here at MS that want you to have the best experience.
<drive>:\system volume information\DFSR\ $db_normal$ FileIDTable_* SimilarityTable_* <drive>:\system volume information\DFSR\database_<guid>\ $db_dirty$ Dfsr.db Fsr.chk *.log Fsr*.jrs Tmp.edb <drive>:\system volume information\DFSR\config\ *.xml <drive>:\<replicated folder>\dfsrprivate\staging\* *.frx
<drive>:\system volume information\DFSR\
$db_normal$ FileIDTable_* SimilarityTable_*
<drive>:\system volume information\DFSR\database_<guid>\
$db_dirty$ Dfsr.db Fsr.chk *.log Fsr*.jrs Tmp.edb
<drive>:\system volume information\DFSR\config\
*.xml
<drive>:\<replicated folder>\dfsrprivate\staging\*
*.frx
This should be validated carefully; many anti-virus products allow exclusions to be set but then do not actually abide by them. For maximum performance, you would exclude scanning any replicated files at all, but this is obviously unfeasible for most customers.
Going back to those same tests I showed earlier with 32 spokes replicating back to a single hub, note the average performance behavior when the data was perfectly pre-seeded:
Test Spokes Hubs Topology GB/node Unique RG Tuned Staging Net Time to sync C9 32 1 Collect 1 Yes 32 Y 4GB 1Gbps 0:49:21 C11 32 1 Collect 1 Yes 32 Y 4GB 512Kbps 0:46:34 C12 32 1 Collect 1 Yes 32 Y 4GB 256Kbps 0:46:08 C13 32 1 Collect 1 Yes 32 Y 4GB 64Kbps 0:48:29
Staging
Net
C9
4GB
0:49:21
C11
0:46:34
C12
0:46:08
C13
64Kbps
0:48:29
Even the 64Kbps frame relay connection was nearly as fast as the LAN! This is because no files had to be sent, only file hashes. Note: do not use this table to predict replication times. It is designed to show behavior trends only.
Even the 64Kbps frame relay connection was nearly as fast as the LAN! This is because no files had to be sent, only file hashes.
Note: do not use this table to predict replication times. It is designed to show behavior trends only.
As a side note, customers periodically open cases to report “memory leaks” in DFSR. What we discuss is that DFSR intentionally caches as much RAM as it can get its hands on – really though, it’s the ESE (Jet) database doing this. So the idler other processes on a DFSR server are, the more memory a DFSR process will be able to gobble up. You can see the same behavior in LSASS’s database on DC’s.
If using iSCSI, make sure you have redundant network paths to the disks, using multiple switches and NIC’s. We have had quite a few cases lately of no fault tolerance iSCSI configs that would go down for hours in the middle of DFSR updating the database and transaction logs, and the results were obviously not pretty.
And that’s it.
- Ned “fork” Pyle
It’s your guest writer Herbert Mauerer again.
A very common AD disaster is an unexpected deletion or modification of objects. Unlike a bad football match or family meeting, you can prepare for that and make the crisis more bearable. In this blog, I will discuss best practices of Windows Server 2003 and 2008 forest level backup and restore. I will not discuss Windows 2000 as it’s at the end of its lifetime, and also not Windows 2008 R2 because we have a pretty good solution for object deletion without the need for backups: AD Recycle Bin.
AD Object deletions and unwanted modifications are often due to human error. Sometimes a bad script does that or a provisioning system, but then these are also created by humans. The common factor is the data loss. Now there is quite some complexity in the current KB article on AD object restores:
840001 How to restore deleted user accounts and their group memberships in Active Directory http://support.microsoft.com/default.aspx?scid=kb;EN-US;840001
We basically follow method 1 in the article 840001, with a few tweaks and preparations:
Step 2 requires that you remove and re-add all group members. This is relatively easy using the Windows Server 2003 command line tools for querying and changing AD objects:
Dsget group CN=GroupX,OU=Groups,DC=contoso,DC=com /members | dsmod group CN=GroupX,OU=Groups,DC=contoso,DC=com /chmbr
This command gets the members of the group and replaces the members with the output, thus adding them as LVR members. This may mean some replication traffic if you apply this to many groups within a short time. However, since the removal and re-adding of members happened in a very short time, you should not see the member go away, as all changes should be replicated in the same replication job.
There are two problems with this approach:
How to Convert Groups for LVR
You can determine the state of linked attribute values like group memberships from the replication meta-data on the object. When you run "repadmin.exe /showobjmeta", the link "Type" says LEGACY:
Type Attribute Last Mod Time Originating DC Loc.USN Org.USN Ver Distinguished Name ======= ======== ============= =============== ========= ========= === ========================================== LEGACY member CN=test-user1,OU=Test-OU,DC=contoso,DC=com PRESENT member 2008-09-16 18:22:29 HQ\contoso-DC1 175379684 175379684 1 CN=test-user2,OU=Test-OU,DC=contoso,DC=com
The line for LEGACY does not have data on the latest change all these values share that with the attribute meta-data listed in the first part of the output.
Hint: I use the "for" command in CMD for loops for direct execution on the command line. When you use CMD scripts, you need to change loop variables like "%f" to "%%f".
The steps are:
1. Freeze the group memberships, stop all group member management.
2. Export the groups in your domain:
Dsquery group dc=contoso,dc=com /limit 0 > grouplist.txt
Review the list and remove all built-in groups. You cannot remove all members there, and these groups usually don’t have many members to begin with. Also, there’s hope nobody deletes the memberships for these.
3. Get all group members on a Windows Vista member with RSAT or Windows Server 2008 computer:
For "delims=" %f in (grouplist.txt) do DSGET %f /members > groupmembers\%f
Important: The DNs of the groups must not contain characters ":\/*?". If you need to rename a group or an OU, it’s sufficient to change the DN.
4. Now we count the members:
In object counting, I use an older version of the MKS toolkit WC.EXE which counts lines, words and characters. You need a similar tool that counts lines in text files. You may have a favorite tool for that, or use a text editor that provides a line count, and use that to get the line count for the bigger output files.
For "delims=" %f in (grouplist.txt) do wc groupmembers \%f >> membercount.txt
The file membercount.txt has the count of members in the first column. Groups with more than 5000 members require special treatment. I suggest moving their member list into a folder "big-groups1".
5. For all other groups, execute:
Dir /b groupmembers >grouplist-small.txt For /f "delims=" %f in (grouplist-small.txt) do dsmod group "%f" /chmbr < " groupmembers\%f"
Hint: "%f" is in double quotes here as "dir /b" does not print quotes, and we want to handle names with spaces properly.
So after this, the small groups are off our radar.
6. Now for the big groups:
My suggestion is to split the membership lists into multiple text files of approximately 5000 lines and put these sections into separate folders with the same file names (the DN of the group):
Dir /b big-groups1> big-groups1.txt For /f "delims=" %f in (big-groups1.txt) do dsmod group "%f" /chmbr < " big-groups1\%f"
Dir /b big-groups2> big-groups2.txt For /f "delims=" %f in (big-groups2.txt) do dsmod group "%f" /chmbr < " big-groups2\%f"
7. Verify the change by getting the group meta-data:
For "delims=" %f in (grouplist.txt) do repadmin /showobjmeta . %f > group-meta\%f
The output files in “group-meta” should have "LEGACY" only for other attributes.
Well, this was quite some work. The good news is that we don’t have to worry about the primary group… :-)
I suggest you test-drive this with test groups, for these tests it does not matter that the members are in LVR mode already. Then expand the work to smaller OU trees until you tackle the rest of the domain. One idea would be to split out parts of the group-list.txt so you impact a few groups only.
Suggested Fixes
After Windows Server 2003 Service Pack 2 was released, we had two problems affecting replication after a (authoritative) restore:
937855 After you restore deleted objects by performing an authoritative restoration on a Windows Server 2003-based domain controller, the linked attributes of some objects are not replicated to the other domain controllers http://support.microsoft.com/default.aspx?scid=kb;EN-US;937855 943576 Active Directory objects may not be replicated from the restored server after an authoritative restore on a Windows Server 2003-based domain controller http://support.microsoft.com/default.aspx?scid=kb;EN-US;943576
937855 After you restore deleted objects by performing an authoritative restoration on a Windows Server 2003-based domain controller, the linked attributes of some objects are not replicated to the other domain controllers http://support.microsoft.com/default.aspx?scid=kb;EN-US;937855
943576 Active Directory objects may not be replicated from the restored server after an authoritative restore on a Windows Server 2003-based domain controller http://support.microsoft.com/default.aspx?scid=kb;EN-US;943576
When you install Fix 943576 on the DCs you backup on a regular basis, you should not see any issues. In the long run, you should get this fix on all DCs in the enterprise. This problem is fixed in Windows 2008.
On top of that, there are also problem with the tool we use to restore the objects, NTDSUTIL.
Problems with object names containing extended characters: 886689 The Ntdsutil authoritative restore operation is not successful if the distinguished name path contains extended characters in Windows Server 2003 and in Windows 2000 http://support.microsoft.com/default.aspx?scid=kb;EN-US;886689 910823 Error message when you try to import .ldf files on a computer that is running Windows Server 2003 with Service Pack 1: "Add error on line LineNumber: No such object" http://support.microsoft.com/default.aspx?scid=kb;EN-US;910823 Problems with excessive links in the LDIF files: 951320 The ntdsutil.exe utility in Windows Server 2003 writes out too many links to .ldf files during an authoritative restore process http://support.microsoft.com/default.aspx?scid=kb;EN-US;951320
Problems with object names containing extended characters: 886689 The Ntdsutil authoritative restore operation is not successful if the distinguished name path contains extended characters in Windows Server 2003 and in Windows 2000 http://support.microsoft.com/default.aspx?scid=kb;EN-US;886689
910823 Error message when you try to import .ldf files on a computer that is running Windows Server 2003 with Service Pack 1: "Add error on line LineNumber: No such object" http://support.microsoft.com/default.aspx?scid=kb;EN-US;910823
Problems with excessive links in the LDIF files: 951320 The ntdsutil.exe utility in Windows Server 2003 writes out too many links to .ldf files during an authoritative restore process http://support.microsoft.com/default.aspx?scid=kb;EN-US;951320
The good news is that having fix 951320 on the DCs you backup often also takes care of problem 910823. Fix 951320 is included in Windows Server 2008 Service Pack 2.
There is a new problem with authoritative restores where objects are not treated correctly in replication. We have a corrective fix in NTDSUTIL for that:
974803 The domain controller runs slower or stops responding when the garbage collection process runs http://support.microsoft.com/default.aspx?scid=kb;EN-US;974803
This last problem is not fixed in Windows Server 2008 yet. The problem cannot happen on Windows Server 2008 R2.
How to Avoid Accidental Deletion
Most of the AD objects recovery cases we see in our support work are because of accidental deletions. Typically, there are whole OUs with lots of user, groups and computer accounts affected. These objects have attributes that can’t be recovered by re-creation as you can’t get the same Sid again.
For this problem, Microsoft has implemented an option in the Windows Server 2008 Admin Tools, also available for Windows Vista using RSAT (Remote Server Administration Toolkit). This version has a check box "Protect object from accidental deletion” when “advanced view” is enabled. This flag is set automatically on all OUs you create with this admin tool.
When this is used, the OU itself and its parent get ACEs (Access Control Entries) that deny "Everyone" the permission to delete the object itself and child objects. This works with Domains hosted on Windows Server 2003. You can add the ACEs this way using your own tools and scripts and you will get the same effect.
Thus such a mass deletion should not happen by accident anymore, as you need to step through clearing the check box. Yes, the deletion might still happen from a script, but then it’s written to remove these ACEs and brings the problem to the next level, the script programmer. At this point, you can’t call it accidental anymore.
A Solution
For the object deletion scenario, Windows Server 2008 R2 offers the AD Recycle Bin. The forest needs to run in the Windows Server 2008 R2 forest mode and the feature needs to be enabled separately.
All objects that are deleted will have no attributes removed anymore, and linked attributes will have a third state to signal they are inactive pointing to a deleted object. When the object is reactivated, the link state will be switched to active again.
The graphical user interface for this facility is not in this release, but the groundwork is done, PowerShell is available, and there are scripts to help you perform the recovery.
Until you can enable this feature, the task is to be prepared for object deletions. This article will still be useful for unwanted object attribute modifications.
Herbert “by way of Germany” Mauerer
Hiya folks. The mail sack was a no-show last week since I was out of town; I hope you can find it in your heart to forgive me. If not… well, you get what you pay for. To make up for it, this one is longer than usual. Here are some interesting issues from the past two weeks (both from the Internet and internally too).
I’m replicating files with DFSR. I’ve found a large number of files that have had the TEMPORARY attribute set on them. I know that DFSR won’t replicate those files, so I am going to remove that attribute. What happens after I do that?
Short answer: they will replicate. :-)
Long answer: DFSR treats temporary files like they do not exist. This means if a file was normal and replicated between servers, then someone sets the temporary attribute on that file, it is no longer there as far as DFSR is concerned. When a file no longer exists, we treat it as - wait for – deleted! So the downstream servers from the originating change are going to delete that file.
Here is the debug log from the server where the temporary attribute was just set:
20100325 17:48:46.067 1836 USNC 2881 UsnConsumer::TombstoneOrDelete LDB Updating ID Record: <— Hmm, looks like it’s being treated as a deletion to me. + fid 0x700000000EB52 <— Note the File ID + usn 0xfa1ead8 + uidVisible 1 + filtered 0 + journalWrapped 0 + slowRecoverCheck 0 + pendingTombstone 0 + internalUpdate 0 + dirtyShutdownMismatch 0 + meetInstallUpdate 0 + meetReanimated 0 + recUpdateTime 20100325 21:47:46.739 GMT + present 0 + nameConflict 0 + attributes 0x20 + ghostedHeader 0 + data 0 + gvsn {16EC84D2-ECEE-4E0D-B6FA-0C4137F65EE4}-v277 <— Note the version + uid {F5C8EE4D-3C55-42A4-BB62-63F72E7EEBED}-v50 + parent {780F3375-CDB0-4583-A3AE-85845086E884}-v1 + fence Default (3) + clockDecrementedInDirtyShutdown 0 + clock 20100325 21:48:46.067 GMT (0x1cacc64f1e63a10) + createTime 20100325 21:47:29.386 GMT + csId {780F3375-CDB0-4583-A3AE-85845086E884} + hash E30F7F47-58F6FE00-B9846C04-43B82E2A + similarity 00000000-00000000-00000000-00000000 + name ohnoes!.txt <— Note the name + 20100325 17:48:46.067 1836 USNC 2887 UsnConsumer::TombstoneOrDelete ID record tombstoned from USN_RECORD: + USN_RECORD: + RecordLength: 96 + MajorVersion: 2 + MinorVersion: 0 + FileRefNumber: 0x700000000EB52 <— Same FID + ParentFileRefNumber: 0x1AD000000008E29 + USN: 0xfa1ead8 + TimeStamp: 20100325 17:48:46.067 Eastern Standard Time + Reason: Basic Info Change Close + SourceInfo: 0x0 + SecurityId: 0x0 + FileAttributes: 0x120 <— This is 0x20 && 0x100, which is a file with the archive bit and the temporary attribute set. Testify! + FileNameLength: 30 + FileNameOffset: 60 + FileName: ohnoes!.txt <— Same name
20100325 17:48:46.114 2304 JOIN 1244 Join::SubmitUpdate Sent: uid:{F5C8EE4D-3C55-42A4-BB62-63F72E7EEBED}-v50 gvsn:{16EC84D2-ECEE-4E0D-B6FA-0C4137F65EE4}-v277 name:ohnoes!.txt connId:{2F726EBA-3970-4AA5-AD23-4C07600CE427} csId:{780F3375-CDB0-4583-A3AE-85845086E884} csName:condelrf <— Same name, same version being sent to the server’s partner. Since the last operation was delete, guess what we’re telling the other server to do?
Then later, I remove the temporary attribute:
20100325 17:49:07.523 1836 USNC 2703 UsnConsumer::CreateNewRecord LDB Inserting ID Record: <— Well hello there! Just like a new file got added. It will replicate out momentarily… + fid 0x700000000EB52 + usn 0xfa1eb98 + uidVisible 0 + filtered 0 + journalWrapped 0 + slowRecoverCheck 0 + pendingTombstone 0 + internalUpdate 0 + dirtyShutdownMismatch 0 + meetInstallUpdate 0 + meetReanimated 0 + recUpdateTime 16010101 00:00:00.000 GMT + present 1 + nameConflict 0 + attributes 0x20 + ghostedHeader 0 + data 0 + gvsn {16EC84D2-ECEE-4E0D-B6FA-0C4137F65EE4}-v278 + uid {16EC84D2-ECEE-4E0D-B6FA-0C4137F65EE4}-v278 + parent {780F3375-CDB0-4583-A3AE-85845086E884}-v1 + fence Default (3) + clockDecrementedInDirtyShutdown 0 + clock 20100325 21:49:07.523 GMT (0x1cacc64feb0277e) + createTime 20100325 21:49:07.523 GMT + csId {780F3375-CDB0-4583-A3AE-85845086E884} + hash 00000000-00000000-00000000-00000000 + similarity 00000000-00000000-00000000-00000000 + name ohnoes!.txt
Craig Landis has written all kinds of interesting stuff about the temporary file attribute and DFSR in this old blog post here and now in the new TechNet Wiki here. Maybe someone will update the Wiki with this new tidbit? Hmmm…. could be you!
Is there a way to make the “AD Users and Computers” snap-in (DSA.MSC) always open in “Advanced Features View” by default? I can’t find any command-line switches or registry settings that handle this scenario.
Oh MMC, how you taunt us. ADUC stores all of its configuration info inside of a special (read: not well documented and highly proprietary) cache file in your profile. You can see it by opening this folder:
%appdata%\microsoft\mmc
Good luck reading the contents of the DSA file though. The setting is stored in there as binary goo. I suppose you could copy your cache file around from place to place and use that, but seems like it would be a rather risky operation with little gain over the the 2 seconds it takes to click:
Perhaps a better idea is to have an "Admin” Terminal Server that has all your favorite applications configured the way you like ‘em. Maybe even using RemoteApp.
I am looking for documentation on how the Root CA communicates with the Sub CAs in a Microsoft PKI. Once the self-signed certificate has been put on the Root CA, is it enrolled or replicated to the Sub CAs? I guess the question is this: once the self signed certificate has been put on the Root CA is it enrolled or replicated to the Sub CAs? We have NPS installed and are using it as a Radius server for the AP's and Wireless LAN Controller. We have a 802.1x policy configured and have the NPS Server validating the wireless client. The client is getting a Wi-Fi policy and a PKI-Policy through a Domain Group Policy. In this environment the wireless clients are getting a certificate with a PKI Policy but when you look at the certificate on the laptop once the system has been logged on the certificate could be issued from any of the Sub CAs. Is this the normal process?
Root CAs and subordinate CAs don't "communicate" with each other in quite that fashion. In fact, the only time any user or computer (sub CAs included) would need to contact the Root CA, outside of management tasks, is if they wanted to request a certificate. Within the sphere of the Windows CA itself, the answer to your question is no, the root CA certificate is not automatically propagated to subordinate CAs. This task must be done via another process.
If the Windows root CA has been installed on a domain server then the CA will automatically publish its root CA into Active Directory. Every Windows workstation or server will automatically retrieve the root certificate once its presence is detected and thus trust the new CA. If the Windows root CA was installed on a non-domain server then the root certificate must be published to Active Directory manually. Since you mentioned that enrollment is occurring successfully, I don't believe that trusting the root CA is an issue for you.
The next thing to address is how Windows client select the CA from which they request a certificate. The following discussion assumes that CEP/CES has not been installed and that CAs are installed in Enterprise Mode. This process applies to any version of Windows from Windows XP onwards. First, there are two contexts in which certificates can be requested -- the user context or the local computer context. Users can request certificates manually via the Certificates MMC snap-in or the Web Enrollment pages, or certificates may be assigned by an Administrator and distributed by Autoenrollment. Computer certificates can also be requested manually by a local Administrator using the Certificates MMC snap-in, or also by Autoenrollment. Regardless of the context, or how enrollment occurs, the process is the same.
1. The Windows Certificate Client (WCC) queries Active Directory for a list of certificates for which the account (user or computer) has Enroll (or Autoenroll) permissions. This information may be cached in the registry, but is periodically refreshed. 2. The WCC then queries Active Directory for a list of available CAs in the forest. Each CA publishes an Enrollment Services object that holds the FQDN of the CA server and the list of templates available on that CA. 3. The list of templates and the list of CAs (and their configured templates) are combined to build a list of those templates for which the account has permission to request a certificate AND which are available on some trusted CA in the forest. 4. In the case of the Certificates MMC snap-in, this combined list is presented in the UI as a list from which the user can select. In the case of Autoenrollment, this list is compared against those templates assigned to the account via Group Policy. 5. Once a template and the CA have been selected, the public/private key pair is created, the request is generated, and the request is submitted to the CA. Depending on the template settings, the request may be fulfilled immediately or it may be pended so that the request can be manually approved.
What this means for you is that you need to determine the following:
1. Is the Root CA in Enterprise or Standalone mode? If the latter, it will not issue certificates based on templates which eliminates the ability to request certificates via the MMC, or through Autoenrollment. 2. Do you have a certificate template that you assign specifically through your PKI-Policy? If so, on which CAs is that template configured? Check the Certificate Templates folder in the Certificate Services snap-in. (HINT: If you don't have one, the CA is in Standalone mode.)
So, if your root CA isn't configured to issue certificates based on your PKI-Policy template, or is in Standalone mode, but your subordinate CAs *are* configured to issued certificates based on that template, then it's no surprise all the certificates you've looked at were issued from one of the subordinate CAs. Funnily, this is actually a good thing. The purpose of a root CA is to be a Trust Anchor for your entire PKI. It issues certificates to subordinate CAs, which in turn issue certificates to users and computers on your network.
If you want an old but still decent introduction to PKI concepts check out Microsoft Windows 2000 Public Key Infrastructure (http://msdn.microsoft.com/en-us/library/ms995346.aspx). If you want the latest and greatest info and a lot more depth, you should pick up the book "Windows Server 2008 PKI and Certificate Security" by Brian Komar (http://www.microsoft.com/learning/en/us/book.aspx?ID=9549&locale=en-us)
[If you can’t tell, this came from Jonathan, the man who never uses a sentence when a paragraph will do – Ned]
Hey, there are a bunch of different companies that make software to do X. Can you recommend one?
Nope! If I recommend one over a bunch of others, the others can get really mad. And in case you haven’t noticed, we, ummm, get sued a lot. Even if the other ones don’t sue and only complain loudly over the Internet, and shaking that bush is a real no-no here in Support. So forgive us if we take a pretty hard line and recommend nothing.
I will say this: any good vendor will be more than happy to let you run a fully functional time-bombed trial edition and give things a whirl. An excellent one will let you access their online knowledgebase and support forums before you buy. I am always suspicious of those who do not want you to see any dirty laundry until the check has cleared. Everyone has a competitor; there are no real monopolies in the software world. Use that to your advantage when evaluating new products.
On a Windows Server 2008 R2 computer I can only get back to Vista for compatibility mode (this computer is running some old stuff via remote desktop services). Why is this and is there a way to at least get back to XP mode?
You tricked yourself – it depends on the application architecture you are running:
The one on the left is a 32-bit program. The one on the right is a 64-bit program. Both are on the same computer. Win2008 R2 runs 64-bit only and when it comes to 64-bit programs, can only pretend back as far as Vista 64-bit RTM. If you need more than this you will need to pay a visit to the Application Compatibility Toolkit. Or, you know, upgrade your crummy old app… ^_^
Hey, sometimes the questions aren’t about DS necessarily. They just need to be interesting enough to make me care. In this case I had no idea, had to figure it out.
Until next time.
- Ned “get to da choppah!” Pyle
Hi Everyone, Mike here. Today I am discussing the default processing behavior for Group Policy scripts. Microsoft changed the default behavior of Group Policy startup and logon scripts processing from synchronous to asynchronous starting with Windows Vista and Windows Server 2008. This behavior is the same in Windows 7 and Windows Server 2008 R2. I’ve recently read some confusion regarding this policy setting.
The default processing behavior for computer startup scripts is asynchronous. Asynchronous scripts processing is when computer startup scripts no longer wait for the previous script to complete before starting the next startup script. Versions of Windows prior to Windows Vista defaulted to synchronous processing. This behavior can be changed by reading from the following locations, in the following order.
Key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon ValueName: RunStartupScriptSync
Key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System ValueName: RunStartupScriptSync
The default processing behavior for Group Policy logon scripts is asynchronous. However, this behavior can be changed by reading from the following locations, in order.
Key: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon ValueName: RunLogonScriptSync
Key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon ValueName: RunLogonScriptSync
Key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System ValueName: RunLogonScriptSync
Key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System ValueName: RunLogonScriptSync
User Logoff and Computer Shutdown Group Policy Scripts always process synchronously.
Customers are noticing timing issues with their computer startup scripts when using Windows 7 and Windows Server 2008 R2. Yes, this is true because the default behavior changed to run these scripts asynchronously. If you relied on the previous behavior, then you need to configure computer startup scripts to run synchronously. Unfortunately, this is where some confusion surfaces.
You’ll soon notice that Windows does not include a policy setting to enable computer startup scripts to run synchronously, or does it? Yes, it does; however, not so intuitive. I’ve had some GP administrators break out the nice search feature in the Group Policy Management Editor and search for the keyword synchronous—this is not going to return the information you are seeking. The policy setting to enable this does not include the word synchronous in the explain text or in any other portion of the policy. You need to configure the Run startup scripts asynchronously policy setting to disabled to force computer startup scripts to process synchronously, which is the default behavior prior to Windows 7 and Windows Vista.
Hopefully, this will clear up any confusion with how Windows 7 process computer startup scripts and explain how to restore the older behavior.
- Mike “Tips and Tricks is Ned’s kryptonite” Stephens
KB
981665
Code sample that shows how to filter IOCTLs that retrieve ATRs from a smart card reader driver by using the Windows 7 WDK
978977
An exclamation mark (!) may be displayed next to the smartcard reader in Device Manager after you start Windows 7 or Windows Server 2008 R2
Blogs
Background uploading of User Registry Settings
WMI Filter Friday
“Network Path Not Found” and “The Specified Network Name Is No Longer Available” errors when running Symantec antivirus products on Windows Server
Open PowerShell Cookbook Beta Available Online
Hotfix: “Configure new tab page default behavior” does not work
Delegating Printer Management Tasks in Windows Server 2003
Out-of-band Hardware Management using WS-Management and Powershell
Correction to forest recovery procedures published
How to use Group Policy to configure Internet Explorer security zone sites
Announcing Windows Server 2008 R2 and Windows 7 Service Pack 1
Windows XP Mode now accessible to more PCs
New Networking-related KB articles for the week of March 7 – March 13
Delegation tab missing in ADU&C
Collecting WinRM Traces
Five Group Policy preferences you must implement right now
Troubleshooting KDC 7 event errors when no one else can
Group Policy Setting of the Week 18 – Allow file download (Internet Explorer)
Hey everyone, Mike here again to discuss an interesting feature I learned about in Windows 7. Many Microsoft customers deploy Roaming User Profiles. In fact, many combine Roaming User profiles and Folder Redirection to get the best experience possible. However, one of the drawbacks with Roaming User profiles is the user must logoff before their settings are uploaded to the server. Folder redirection solves this problem for any of the known folders within the user profile namespace, such as Documents, Music, or Downloads—the data is highly available without requiring a user logoff. Now, if this could only occur with user’s registry settings.
Windows 7 solves this problem by allowing the User Profile service to upload the user’s registry settings of a Roaming User profile while the user remains logged on to the computer, or terminal services session (provided the session is hosted on Windows Server 2008 R2).
You enabled this feature using Group Policy. The policy setting Background upload of a roaming user profile’s registry file while user is logged on, is located under Computer Configuration\Policies\Administrative Templates\System\User Profiles. The policy setting offers two configuration settings: scheduled or interval. The scheduled method allows you to configure a time of day (represented on 24 hour time) at which to upload the user’s registry settings. The interval method allow you to choose a specific interval (represented in hours) at which to upload the user’s registry settings. This method accepts an interval range between 1 and 720 inclusively. Both settings include a random delay that does not exceed one hour.
Figure 1 Background upload policy setting in Windows 7
Background uploading only occurs with Roaming User profile. Also, background uploading does not alter uploading the entire profile when the user logs off. It is important to remember that background uploading only uploads the user’s registry settings (ntuser.dat).
Now those subtle changes made in the registry can be uploaded to the server while the user remains logged on. Pretty cool.
Mike “the other Mike Stephens” Stephens
In addition to the normal list of KBs and blog posts, here is a look at the topics related to Directory Services that have been created on the TechNet Wiki recently.
TechNet Wiki Topics
Automating DFSR Health Report Creation
DFSR Does Not Replicate Temporary Files
DFSR performance objects, their counters, corresponding WMI classes, and using WMIC or vbscript to view them
Gathering a Network Trace During Computer Startup
How to Back Up and Restore NTFS and Share Permissions
How to Reset Secure Channel Remotely Using Script
How to Reset the Local Administrator Password on Multiple Computers Remotely
Windows MMC Snap-ins (.MSC)
Windows Server: Microsoft Blogroll
Advanced Security Auditing in Windows 7 and Windows Server 2008 R2
Step-by-Step Guide to Bulk Import and Export to Active Directory
Default User Accounts and Groups
Managed Service Accounts (MSAs) versus virtual accounts in Windows Server 2008 R2
Managing Trusts
Hyper-V: How to run Hyper-V on a laptop
Hyper-V: Survival Guide
Windows PowerShell: Survival Guide
What VMM Does with AZMan Role Definitions from Hyper-V
Elevation of Privilege - The Game
980959
The "Configure new tab page default behavior" Group Policy setting does not work on a computer that is running Windows 7 or Windows Server 2008 R2 and that has Internet Explorer 8 installed
979470
The "Remote Desktop Services" service cannot protect a console session from being disconnected in Windows Server 2008 R2
USMT and /SF
Friday Mail Sack – Mogwai Edition
The Terminator Script
Lock Your Workstation
New identity management software takes the heat off of IT
Active Directory Domain Services Command Fu, Part 1
Is DirectAccess a threat to Windows security?
ADFS To the Rescue!
New Networking-related KB articles for the week of February 28 – March 6
How to use Group Policy to remove the Adobe Reader desktop shortcut
Group Policy Team Blog : Visual C# Samples Using the GPMC Class Library Published!
Explaining Close_Wait
How to customize your Windows PowerShell environment
Expert to Decrypt TLS/SSL Traffic
SAML vs. XACML for Authorization: VHS versus Betamax?
The Effective Security Practices Whitepaper Series
How to use Group Policy to remove the Network Connectivity Status Indicator message in your network icon
Hi folks, Ned here again. This week we hunt down some documentation gremlins and give them a well-deserved smack.
Also, things will be a bit slow next week as I will be out in Redmond teaching this rotation of Microsoft Certified Masters. Never heard of it? If you’re at the IT career tipping point, this may be just what the doctor ordered. No really, it is, and I will be there!
What exactly does the dcdiag.exe /fix command do? According to this it fixes the SPNs on the DC machine account. But according to this it ensures that SRV records are appropriately registered (I thought the NetLogon service did this?!). And what exactly does the netdiag.exe /fix command do? This article says it "fixes minor problems", whatever that means.
1. Dcdiag /fix writes back the computers account’s AD replication SPN (DRSUAPI with an index value of “E3514235-4B06-11D1-AB04-00C04FC2DCD2”) entry only. More info on this SPN here:
http://msdn.microsoft.com/en-us/library/dd207876(PROT.13).aspx http://msdn.microsoft.com/en-us/library/ee791539(PROT.10).aspx
If someone (else!) has destroyed all the other SPN’s, you will need to recreate them or restart whichever service recreates them. For example if the DFSR SPN goes missing, you restart the DFSR service and it will get put back.
2. Netdiag /fix reads the %systemroot%\system32\config\Netlogon.dns file and attempts to register all records in DNS.
I confirmed both in source code, regardless of what old TechNet goo states. :-)
In Win2008 DFSR has been improved regarding the asynchronous RPC connections and 16 concurrent connections for upload and download. Do you have any further info on how improved the performance will be from Win2003 R2 to Win2008/2008 R2? Are there any other factors that would drive me to start rolling out the later OS versions?
I will be posting posted some new info about performance improvements in 2008/2008 R2 as well as registry tuning options in the coming weeks. But we don’t have any specific case studies that I am aware of yet – I’ll see if I can find them, and if you do, feel free to comment. We do have some rather unspecific ones, if you’re interested.
From testing and customer experience though, we see anywhere from a 4 to 20 times performance improvement of 2008 over 2003 R2, depending on a variety of factors that are often very customer specific (network speed, bandwidth, latency, loss rates, errors, overall uptime + memory + CPU + disk subsystem + drivers). Not only did DFSR improve, but the OS got improvements and it makes better use of newer hardware. Besides the RPC and other changes, Win2008 tweaks the DFSR credit manager, and 2008 R2 really improves it – much more evenly-distributed replication with greatly lowered chance of servers being starved by updates.
Other factors:
I am using your old blog post on making custom registry changes and…
Ewwwww… The only reason to use that old document is if you are still running Windows 2000 somewhere. Otherwise you should be busting out Group Policy Preferences and wowing your friends and family.
Oh, and really? You’re running Win2000? That’s very uncool of you…
I am doing USMT migrations with /SF. What is that switch and why are my migrations absolutely busted to heck?
This one came in late last week and was so gnarly that it ended generating a whole blog post. Read more here. Sometimes your questions to us generate more than a Friday reply.
Good work, Internets!
– Ned “3 important rules” Pyle