Delegate Permissions for an OU in Active Directory Users and Computers (ADUC) & Create a Custom MMC, or Just Use RSAT

Updated 9/20/2016

Note- this was put together and fast published and there may be errors. Check back for updates when I add RSAT info.

Prologue

Ace here again. Yep, me again. This scenario comes up time to time. Sure, you can use the RSAT tools, but here an old fashioned, truly tried method that works nicely so a delegated OU admin can only see and do what they need to do in their OU.

Scope

After you Delegate Permissions in to a limited admin in Active Directory, such as the ability to reset passwords, you may want to create a custom ADUC MMC (console or custom taskpad)  for the delegated admin to control the portion of AD (the OU) they are allowed or delegated in.

For Windows 2003 AD – but it will work in 2008 and newer

The last time I set this up for a customer, involved a snap-in for each ‘location’ OU, I allowed to retain the rt-click context, and the tree view available in the custom console (left pane and right pane), but I removed everything else including the file menu buttons and such. So under View, Customize, uncheck everything except the top one that says Console Tree. This way they can’t go up level or click any of the things in there. But they will have the right-click feature.
 
You can also choose to remove the left hand pane (tree view).

MMC v2 and v3 are the same:

  • Start/run/mmc, hit enter
  • File, Add-Remove Snap-in, Add ADUC
  • Drill down under the domain to the OU you want.
  • Right-click on that OU, choose new window from here.
  • A new window pops up with the OU in the left pane and the contents in the right pane.
  • Close the original ADUC window leaving the new window open that you’ve just created.
  • Expand the window to take up the whole console. – This will keep them in this section and they will not be able to go up levels and are ‘stuck’ in this OU.
  • Select View/Customize
  • Uncheck everything but Console Tree.
  • File/Options Choose Console Mode, then select:

User mode: Limited Access single window
Check: Do not Save Changes to this console
Uncheck: Allow the user to customize views
Save it.

  • Logon as a test user that was delegated permissions and test it.

If you want to eliminate the ability for the delegated admin to right-click on a user account, uncheck the Console Tree above, then change the console view by right-clicking on the OU, choose New Task View, and choose a vertical or horizontal list, then choose to create a new task, menu command, highlight a user account, choose reset password, or anything else in the right column, choose an icon, and finish.

Copy the .MSC file via a UNC connected to the delegated person’s XP workstation’s \Documents and Settings\username\desktop folder, or if Windows Vista or newer, in the C:\users\username\desktop folder.

Keep in mind, the Active Directory Administration Center, RSAT tools or AdminPak tools, depending on what operating system version the client side is, needs to be installed on the workstation for the ADUC binaries to be available for this task pad to work.

 

For Windows 2003/Windows XP using the AdminPak tools just for the ADUC snap-in, nothing else:

Copy over the following three DLLS from the 2003 or newer DC you are on, to their client’s system32 folder. All three of these are needed on a 2003 DC or newer, or the ADUC won’t open. However, on an XP or newer machine, you only need two. If I were to allow users to change passwords and create a custom MMC for just that OU, then all I need is adprop.dll and dsadmin.dll, otherwise you need all three.

  • adprop.dll (for object properties)
  • dsadmin.dll (ability to alter object properties)
  • dsprop.dll (for object properties related to directory services)

Then you can use PSEXEC (one of the PSTools available free at Microsoft) to remotely register the DLLs listed below on their workstation using the regsrv32.exe utility.
Download PsExec v1.98, by By Mark Russinovich, Published: April 28, 2009
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

  • psexec \\machinename regsvr32 adprop.dll
  • psexec \\machinename regsvr32 dsadmin.dll
  • psexec \\machinename regsvr32 dsprop.dll

Here are some screenshots at the following link:

Create Taskpads for Active Directory Operations:
http://www.petri.co.il/create_taskpads_for_ad_operations.htm

===============================================

For AD on Windows 2008 and newer:

You can use the ADAC & RSAT Tools, or you can use the above method.
Note: ADAC does not have a feature to break down specific tools to create a custom console as shown above.

For the Active Directory Administration Center and the RSAT tools:

For the Related links below for the new AD Admin Center. However, the Admin Center does not have the feature to break down just specific tools to create a custom console as shown above.

Active Directory Administration Center (ADAC):

Active Directory Administrative Center: Getting Started
http://technet.microsoft.com/en-us/library/dd560651(WS.10).aspx

Active Directory Administrative Center —  the New AD interface
http://techibee.com/active-directory/active-directory-administrative-center-a-new-ad-interface-for-win7-and-win-2008/290

Learn New Features in Active Directory Administrative Center
http://www.enterprisenetworkingplanet.com/windows/article.php/3887136/Learn-New-Features-in-Active-Directory-Administrative-Center.htm

Remote Server Administration Tools (RSAT) for Windows operating systems (Discusses how to install it for all versions of Windows)
https://support.microsoft.com/en-us/kb/2693643

Remote Server Administration Tools for Windows 10
https://www.microsoft.com/en-us/download/details.aspx?id=45520 

Customizing – Installing Remote Server Administration Tools (RSAT) for Windows 7
http://www.petri.co.il/remote-server-administration-tools-for-windows-7.htm

Remotely managing your Server Core using RSAT
http://blogs.dirteam.com/blogs/sanderberkouwer/archive/2008/04/27/remotely-managing-your-server-core-using-rsat.aspx
==================================================================

Summary

I hope this helps!

Last updated – 2/2006, updated 9/20/2016

Ace Fekay
MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
Microsoft Certified Trainer
Microsoft MVP – Directory Services

clip_image002[3] clip_image004[3] clip_image006[3] clip_image008[3] clip_image010[3] clip_image012[3] clip_image014[3] clip_image016[3]

Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php

This posting is provided AS-IS with no warranties or guarantees and confers no rights.

Dynamic DNS Updates & How to Get it to Work with DHCP, Scavenging, Static Entries & their Timestamps, the DnsUpdateProxy Group, and DHCP Name Protection

Posted on August 13, 2016 by Ace Fekay

It’s me again. I originally posted this in 4/2006, and updated throughout the years, but I still get questions from time to time asking why updates are not working, especially PTR. Well, I thought it’s time for an update and to just offer a summary in the beginning, because in this day and age, no one wants to read! A quick Facebook read the first line and click “Like,” seems to be the norm.  Well, I will also offer the nitty gritty below the summary for those who want to read.

 

Topics Covered:

  1. Preface: The entity that registers the record into DNS, owns the record
  2. Summary: How to configure DHCP & Dynamic DNS Updates
  3. Scavenging Defined
  4. DNS Timestamp and Scavenging (and info on the dnsTombstoned Attribute)
  5. Scavenging Refresh & NoRefresh Settings must be less than the DHCP Lease Period
  6. DHCP Conflict Detection
  7. DHCP Lease has a “pen” or “pencil” Icon
  8. Records & timestamps, and the lack of timestamps
  9. Related Links

    Preface:

    Dynamic DNS Update Basics:

  10. This is the part that many do not understand. Please read thoroughly before asking me why your PTR updates don’t work.

     

    1. By default, ALL Windows 2000 and newer machines statically configured machines will register their own A record (hostname) and PTR (reverse entry) into DNS.

    Yep. That’s the basic rule. And yea, I had to state Windows 2000 and newer, because this stuff doesn’t apply to older Windows versions.

    2. If set to DHCP, a Windows 2000, 2003 or XP machine, will request DHCP to allow the machine itself to register its own A (forward entry) record.

    But DHCP will register its PTR (reverse entry) record.

    3. If Windows 2008/Vista, 2008 R2, Windows 2012 R2, Windows 7, 8, 8.1, 1, and all future releases, the DHCP server always registers and updates client information in DNS

    Note: “This is a modified configuration supported for DHCP servers running Windows Server 2008 and DHCP clients. In this mode, the DHCP server always performs updates of the client’s FQDN, leased IP address information, and both its host (A) and pointer (PTR) resource records, regardless of whether the client has requested to perform its own updates.”
    http://technet.microsoft.com/en-us/library/dd145315(v=WS.10).aspx

    4. The entity that registers the record in DNS, owns the record.

    Note:  “With secure dynamic update, only the computers and users you specify in an ACL can create or modify dnsNode objects within the zone.

    By default, the ACL gives Create permission to all members of the Authenticated User group, the group of all authenticated computers and users in an Active Directory forest. This means that any authenticated user or computer can create a new object in the zone.

    Also by default, the creator owns the new object and is given full control of it.
        Secure Dynamic Update
        http://technet.microsoft.com/en-us/library/cc961412.aspx

     

    Reference:

    Updating DNS Resource Records
    https://technet.microsoft.com/en-us/library/ff631099%28v=ws.10%29.aspx

    How to configure DNS dynamic updates in Windows Server 2003.
    http://support.microsoft.com/kb/816592

    Using DNS servers with DHCP (Contains information on the DnsUpdateProxy group and its usage)
    http://technet.microsoft.com/en-us/library/cc787034 (WS.10).aspx

    ===============================================================

    Summary: How to configure DHCP & Dynamic DNS Updates

    1. Configure DHCP Credentials.

       The credentials only need to be a plain-Jane, non-administrator, user account.
       But give it a really, REALLY strong password.

    2. Set DHCP to update everything, whether the clients can or cannot.

    3. Set the zone for Secure & Unsecure Updates. Do not leave it Unsecure Only.

    4. Add the DHCP server(s) computer account to the Active Directory,  Built-In DnsUpdateProxy security group.

       Make sure ALL other non-DHCP servers are NOT in the DnsUpdateProxy group.
       For example, some folks believe that the DNS servers or other DCs not be running DHCP should be in it.
       They must be removed or it won’t work.
       Make sure that NO user accounts are in that group, either.
       (I hope that’s crystal clear – you would be surprised on the number of responses I get asking if the DHCP credentials should be in this group.)

    5. On Windows 2008 R2 or newer, DISABLE Name Protection.

    6. If DHCP is co-located on a Windows 2008 R2, Windows 2012 R2, and all future Windows versions Domain Controllers:

       You must secure the DnsUpdateProxy group by running the following command:
       dnscmd /config /OpenAclOnProxyUpdates 0

    7. Configure Scavenging on ONLY one DNS server. What it scavenges will replicate to others anyway.

    8. Set the scavenging NOREFRESH and REFRESH values combined to be equal or greater than the DHCP Lease length.

    Just to be crystal clear, this means that if the lease is an 8 day lease, than  NOREFRESH should be 4 (four) and REFRESH should be 4 (four) so when you add them together, they are not greater than the lease length.

     

    ===============================================================

    Caveat with the DHCP service out-of-the-box configuration

    The goal is to keep DNS clean without duplicate records.

    When a client shuts down, and later returns past the lease time, it may get a different IP address. With the default settings, a duplicate A record gets registered by DHCP with the client’s new IP. This is because the client will not update itself due to the current record in DNS is beyond the lease period. This happens even though DHCP registered the record. This is because DHCP doesn’t own the record, the client does, even though DHCP registered it.

    DHCP Option 081:

    The way to get around this is you can configure DHCP’s Option 081 to update the record for all client, no matter if the client asks or not. To configure DHCP Option 081, you must look at the DHCP server properties, under the DNS Tab in DHCP properties. Despite it being a DHCP Option, it’s not found in a DHCP server, scope or class option.

  11. .

    Overview to make this work:

    • DHCP must own the record, not the client. This is done by configuring DHCP to register all DHCP clients, whether the client supports Dynamic Updates or not.
      • As long as DHCP owns the record, can keep the records in the FLZ and RLZ up to date when the client renews its lease, same IP or different IP.
      • Otherwise you’ll see duplicate A and PTR records in DNS, whether scavenging is enabled or not.
    • Configure DHCP credentials by creating a plain-Jane, Domain User account. It doesn’t have to be an administrator account.
    • Add the DHCP Server object in Active Directory to the DnsUpdateProxy group.
    • In addition, I suggest to enable DNS scavenging to remove stale records, which will keep the zone clean.

    .

    How do we configure DHCP for this to work??

    Summary to Configure Credentials and add the DHCP server to the DnsUpdateProxy group.

    Windows 2008 R2 or newer:

    You have a new feature to prevent Name Squatting: DHCP Name Protection, you still need to configure Credentials and add the server to the DnsUpdateProxy group.

  12. Add the DHCP server to the Active Directory, Built-In DnsUpdateProxy security group.
  13. Configure DHCP Credentials.
  14. Configure Name Protection.
  15. If DHCP is co-located on a Windows 2008 R2 DC, you must secure the DnsUpdateProxy group by running the following:
    dnscmd /config /OpenAclOnProxyUpdates 0 

    Note: Configuring DHCP credentials AND using the DnsUpdateProxy group, and forcing DHCP to update all records, will also allow DHCP to register Win9x machines, as well as non-Windows machines, such as Linux, OSx (BIND based), and other Unix flavors, and update the records when they get renewed with a different IP.

  16. Scroll down to the Name Protection section for more specifics and references,

    For Windows 2008 and older:

    To force DHCP to own and control all records it updates into the DNS zone, there are two parts of the procedure:

    1. Add the DHCP server to the Active Directory, Built-In DnsUpdateProxy security group.
    2. Configure DHCP Credentials.

    .

    Step by Step procedure:

    Step 1: To add the DHCP server’s computer account to the DnsUpdateProxy Group  

      • In ADUC, add the DHCP server’s computer properties to the DnsUpdateProxy security group.

        • In ADUC, click on the Built-In container.
        • Scroll down to the DnsUpdateProxy group.
        • Right-click DnsUpdateProxy group, choose properties
        • Click ADD –  make sure that the search criteria is set to look for computer objects,
        • Either type in the DHCP server’s name and click Check Name or click on Advanced, then click on FIND, and scroll down to the DHCP server name.
        • Once you see the DHCP server’s computer object, highlight it
        • Click OK.

    Step 2: Force DHCP to register all records, Forward and PTR, whether a client machine can do it or not:

    See screenshots below to configure the Option 081 settings under DHCP properties, DNS tab

    Step 3: Configure other DHCP Options as needed

    Suggested basic DHCP options:

    • Set the Connection Specific Suffix DHCP Option 015 to the AD domain name (such as example.com).
    • Set Option 006 to only the internal DNS servers.
    • Option 003 to your router

    Step 4: Configure the zone for Secure Updates Only:

    Credentials and the DnsUpdateProxy group will be used to register them.

    Step 5: Configure DHCP Credentials. Note – you can do this on 2008 R2 and newer, if you chose not to use .    

        • In AD, create and configure a dedicated Domain User account to use as credentials in DHCP.
        • The user account does not need any elevated rights, a normal user account is fine.
        • Choose a very strong password.
        • Set the password so it does not expire.

    Then configure DHCP with the credentials you created:

    For Windows 2003:

    • Open the DHCP Console:

    • Right-click the DHCP servername

    • Choose Properties.
    • Click the Credentials button
    • Provide the account’s credentials

    In Windows 2008 and 2008 R2:

    • Select IP Scope
    • Choose Properties
    • Select the Advanced tab
    • Click the Credentials button
    • Provide the account’s credentials.

    For Windows 2000:

    • It must be done with the Netsh command. Windows 2003 and newer can also be done with the Netsh command, if you desire.

    .

    Note and warning: about using the DnsProxyUpdate group on a DC

    • We normally shy away from adding a DC to the DnsProxyUpdate group, as it weakens security including the DC records if DHCP is on a DC. However, in many cases, there’s not much of a choice.
    • Windows 2008 R2 and newer gives you the option to use the DHCP Name Protection Feature, but as stated above, you still need to configure credentials and add the server to the DnsUpdateProxy group.
    • When DHCP is running on a Windows 2008 R2 domain controller, you must secure the DnsUpdateProxy group by running the following:
      dnscmd /config /OpenAclOnProxyUpdates 0

    .

    Note on older, pre-existing records in DNS:

    After configuring the above provedure, the credentials and DnsUpdateProxy group configuratuion will not update current or delete duplicate records. You must delete them manually to allow DHCP to take care of all new records moving forward.

    Also, it will allevaite another issue – If DHCP is on a DC, it will not overwrite the original host record for a machine getting a new lease with an IP previoulsy belonging to another host. 

    If there is a problem with PTRs getting updated even after configuring credentials, please see this article:

    DHCP server processes expired PTR resource records in Windows Server 2003
    http://support.microsoft.com/kb/837061

    .

    Step by step screenshots:

    Windows 2003:

    .

    .

    .

    Windows 2008 & Windows 2008 R2:

    .

    .

    DHCP Name Protection

    If you have Windows 2008 R2 or Windows 2012 R2, in addition to configuring the DNS tab to force registration, you still must configure credentials and add the server to the DnsUpdateProxy group. If DHCP is on a Windows 2008 R2 DC, to protect the DC when using the DnsUpdateProxy group, you must secure the group by running:

    dnscmd /config /OpenAclOnProxyUpdates 0

    Using  “DHCP Name Protection.” will register A and PTR record on behalf of a client, and will prevent a workstation (non-Windows) Name Squatting, meaning using a name that another machine (non-Windows or Windows) client that DHCP already registered , from registering it’s name. DHCP will give that duplicate named client an IP, but it will not register it into DNS. 

    Quoted from the following link:

    “Name squatting occurs when a non-Windows-based computer registers in Domain Name System (DNS) with a name that is already registered to a computer running a Windows® operating system. The use of Name Protection in the Windows Server® 2008 R2 operating system prevents name squatting by non-Windows-based computers. Name squatting does not present a problem on a homogeneous Windows network where Active Directory® Domain Services (AD DS) can be used to reserve a name for a single user or computer.”

    DHCP Step-by-Step Guide: Demonstrate DHCP Name Protection
    “Name squatting occurs when a non-Windows-based computer registers in Domain Name System (DNS) with a name that is already registered to a computer running a Windows® operating system. The use of Name Protection in the Windows Server® 2008 R2 operating system prevents name squatting by non-Windows-based computers. “
    http://technet.microsoft.com/en-us/library/ee404786(v=ws.10).aspx

    Configuring DHCP Name Protection
    http://technet.microsoft.com/en-us/library/dd759188.aspx

    DHCP: The DNSupdateproxy group must be secured if Name Protection is enabled on any IPv4 scope
    http://technet.microsoft.com/en-us/library/ee941099(WS.10).aspx

    DHCP: Credentials for DNS update should be configured if secure dynamic DNS update is enabled and the domain controller is on the same host as the DHCP server
    http://technet.microsoft.com/en-us/library/ee941099(WS.10).aspx

    .

    To configure Name Protection:

    • Right-click IPv4, choose Properties
    • Click on the DNS tab
    • Click “Configure”
    • Check the box, “Enable Name Protection”

    You can optionally select it on IPv6, too. No harm done, whether you have IPv6 scopes or not.

    .

    You will notice that once you enable it:

    • Except the “Enable DNS Dynamic Updates according to the settings below,” checkbox, everything else under the DNS tab will be grayed out.
      • This is because the Name Protection feature takes over these functions, and will force register everything, so these settings are no longer used.
    • If you have multiple IPv4 scopes, once set at the IPv4 level, it will apply to all IPv4 scopes.
      • If you don’t want it to apply to all scopes, you can selectively disable the setting under each scope, or don’t enable it at the IPv4 level, and selectively enable it on a per scope basis.

    .

    Here’s a screenshot of where to enable it:

    .

    Screenshot of DNS Tab (which is actually Option 081), which grays out. This is because Name Protection took over these functions:

    .

    If you have multiple IPv4 scopes, once set at the IPv4 level, it will apply to all IPv4 scopes.

    Back to top of page>

    .=================================================================

    Scavenging Defined

    Misconceptions about Scavenging

    There are some misconceptions prompting fears that Scavenging will remove everything in your zone, includind servers. Please understand, the main thing that scavenging works on is the timestamp. If there is no timestamp, such as a manually created, static record, it will not get scavenged. Also, if all servers, including DCs, are automatically updating their own record, then there is no fear of losing their records, because for one, their records (timestamps) are current, therefore scavenging won’t touch them, and two, Windows Servers by default will update their records every 24 hours, with the exception of domain controllers at every 60 minutes. Therefore, even if they were to scavenge these records, assuming the time stamp has ever been reached, the machines will refresh themselves anyway!

    DNS UPdate Interval is based on Operating System and Windows Server Role:

    By default, statically configured clients and remote access clients that do not rely on the DHCP server for DNS registration, will re-register their A & PTR records dynamically and periodically every 24 hours. This applies to Windows 2000 Professional and all newer operating systems.
    For domain controllers, due to the importance of keeping up to date and accurate SRV and other records, the Netlogon service will attempt to update these records every 60 minutes.
    By default, on a computer that is running Windows XP/2003 or newer, the DefaultRegistrationRefreshInterval key value controls this (except Windows 2000, whichdoes not have this key but can be added), and is set by default to 1 day. This is true regardless of whether the computer is a client or a server, except domain controllers, which are every 60 minutes.
    You can use the following registry subkey to modify the update interval:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DefaultRegistrationRefreshInterval
    Data type: REG_DWORD
    Range: 0x0 – 0xFFFFFFFF seconds
    Default value: 0x15180 (86,400 seconds = 24 hours) for Windows 2000 Professional
    Default value: 0xE10 (3,600 seconds = 1 hour) for Windows 2000 Server and Windows Advanced Server
    Scope: Affects all adaptors
    This specifies the time interval between DNS update registration updates.
    The default Time To Live (TTL) value used for dynamic registrations is 20 minutes. You can use the following registry subkey to modify the TTL value:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DefaultRegistrationTTL

    .

    In Summary:

    • Scavenging is a feature that will remove expired records based on their Timestamps.
    • Scavenging is not enabled by default.
    • Scavenging will NOT remove statically configured records, the ones you manually create unless you run dnscmd /AgeAllRecords, which will stamp them making them eligible for scavenging (more below on this). Without running this command, DNS will scavenge dynamically updated records that have reached their time stamp. To look at the time stamps of a record using Windows 2003 DNS, put the DNS console “view” in the menu to Advanced View, then look at the individual record properties, and you will see the time stamp. If using Windows 2008 or or newer, it will show up in the console as a separate column.

    .

    Scavenge Refresh and No Refresh vs DHCP Lease period

    Scavenging Refresh and No Refresh settings must be equal to or less than the lease period. For example, using  the default DHCP lease period of 8 days with a 7day scavenge setting, is perfect. If you lower the lease, you need to lower the scavenge settings. If you are using a 4 hour lease, well, that’s a tough one, because the lowest you can go with scavenging is 1 day, and may provide inconsistent results.

    And please bear in mind, as already stated, scavenging will not remove statically configured records, (the ones you’ve manually created). It will scavenge updated records that have reached their time stamp. However, if you run dnscmd /AgeAllRecords, it will timestamp all records, making them eligible for scavenging.More on this in the next section, Static records.

    To set aging and scavenging properties for a DNS server using the DNS Console:

    1. In the DNS console, right-click the DNS server name, and choose “Set Aging/Scavenging for All Zones.
    2. Select the Scavenge stale resource records check box.
    3. You can now either choose to set Scavenging for all zones, or choose No, and manually set each zone individually. I suggest setting it for all zones.
    4. It’s recommended to go with the defaults of 7 days. If you choose to change it, it should reflect and stay in line with DHCP’s lease times. Now I’ve never found anything specific stating this, but keeping the scavenge setting to the lease minus one day, ensures that records will be deleted one day before lease renewal so it will be deleted if that record were actually not in use by a client, and has expired. If still in use, it will go through the scavenging refresh period and scavenge lifetime until the next expiration time.
    5. Once you’ve set scavenging, all records that have a time stamp will be aged,  will get scavenged. This does not include static records, because static records do not have a time stamp.

    Excample of a dynamically created record:

    .

    Static Records:

    Static records will not get scavenged, since they have a 0 time stamp. When viewing a static record, it will show as the following:

    However, regarding static records, if you use force age all records using the dnscmd /AgeAllRecords. If the “Delete the record when it becomes stale” box was checked at time of the record creating, it will set a TimeStamp on it, which will make it eligible for scavenging. Therefore, if you have an static records, host, cnames, etc, they will get scavenged, and I advise to take inventory of your static entries if you run this command. I would suggest not to, and just allow scavenging to take it’s time to do its thing. Be PATIENT!!!!

    .

    You MUST BE PATIENT!!

    .

    Rough formula to go by: NoRefresh + Refresh * 2 + the point in time during the 3 day scavenge period.

    Here’s a chart showing when events occur with a 3-day NoRefresh, 3 day Refresh, and 3 day Scavenging. (Graphics from Don’t Be Afraid of Scavening. You must be patient):

    If you look at the chart, based on scavenging settings of a 3 day NoRefresh and 3 day Refresh, then it becomes eligible for scavenging the day after these two pass, so it will be the 7th day. Then it waits for the next scavenge cycle (I kind of call it the garbage collection point), which is somewhere withing the next 72 hours (based on the NoRefresh). So based on this chart, starting at 1/1/2008, the record becomes eligible on 1/7/2008, then it’s deleted (scavenged) on, in this case, on 1/10/2008, at 6am during the next 72 hour scavenge cycle. The 72 hour scavenge cycle in this case, is based on the 3day scavenge setting..

    That was a total of about 10-11 days, but it could have happened, as you can see in the chart, anytime between the 10th day and the 14th day.

    .

    image

    .

    If you choose the default 7 day setting may take up to 4 weeks + 1 day (29 days) for scavenging to take place.

    .

    .

    AD Integrated zones – Where do you set it? – Enable it only on one server, and the timestamp will replicate with AD replication

    In summary, with using AD integrated zones, you just enable scavenging on one server, then the time stamp will replicate to other servers with the normal AD replication process. When AD integrated zones are involved, DNS uses an additional mechanism to control replicating the records’s time stamp behavior through the dnsTombstoned attribute.

    In addition, regarding enabling it on one server, Josh Jones [MSFT] quotes (in his blog, “Don’t be afraid of DNS Scavenging” ):

    “Although you can set every server hosting the zone to scavenge I recommend just having one. The logic for this is simple: If the one server fails to scavenge the world won’t end. You’ll have one place to look for the culprit and one set of logs to check. If on the other hand you have many servers set to scavenge you have many logs to check if scavenging fails. Worse yet, if things start disappearing unexpectedly you don’t want to go hopping from server to server looking for 2501 events.”

    For more specifics, and to not duplicate Josh Jones’ efforts, please read his blog for specific info – “Don’t be afraid of DNS Scavenging

    Don’t be afraid of DNS Scavenging, Josh Jones [MSFT], 19 Mar 2008 6:49 PM
    http://blogs.technet.com/b/networking/archive/2008/03/19/don-t-be-afraid-of-dns-scavenging-just-be-patient.aspx

    .

    AD Integrated Zones and Scavenging – How does it do it? It uses the AD attribute called, “dnsTombstoned”

    Good article by Guy Teverovsky [MSFT], explaining how AD handles scavenging with records in an AD integrated zone, as well as what happens if say a machine who’s record is marked as dnsTombstoned, but the machine is reinstalled, which now has a new SID, and how it can’t update the original record –  the original host record is not removed immediately:

    DNS Scavenging internals (or what is the dnsTombstoned attribute) for AD Integrated zones, by Guy Teverovsky [MSFT], 23 Sep 2010
    http://blogs.technet.com/b/isrpfeplat/archive/2010/09/23/dns-scavenging-internals-or-what-is-the-dnstombstoned-attribute-for-ad-integrated-zones-dstombstoneinterval-dnstombstoned.aspx

    .

    Other articles on Scavenging:

    Optimizing your network to keep your DNS squeaky clean
    http://blogs.technet.com/b/networking/archive/2009/02/09/optimizing-your-network-to-keep-your-dns-squeaky-clean.aspx

    .

    Enable Scavenging Screenshots

    Screenshots showing enabling scavenging with the default 7 Day NoRefresh, and 7 Day Refresh. Note that scavenging will not kick in until 1 day after these two periods combined, meaning 15 days later. And if you also notice, that after I enabled them, and ran dnscmd /AgeAllRecords, the static records still didn’t show as stamped. Eventually they will. That’s the “being patient” part.

    .

    1.
    https://qis15w.sn2.livefilestore.com/y1pK2oaDPwDuWcOKuruFE_mG60DX_JdOD9PUVuj8YEvK9bo-HK1WMPfHg3_smfglSU6RuKpxkxvZkP1mgb0AFJD_WZ-yUEOo6np/1.%20Set%20Aging-Scavenging%20for%20all%20zones.jpg?psid=1

    .

    2.
    https://qis15w.sn2.livefilestore.com/y1pjeNJXBaiplqSW8EK6KEbWLD7awc19PpsNJEF6S5456DDriVTJUvCAsIH6EbpHb6zu3at6n2jZVN9BuOMVbNZdJQCCzFYi5I8/2.%20Using%20default%207%20day%20scavenge%20settings.jpg?psid=1

    .

    3.
    https://qis15w.sn2.livefilestore.com/y1pBwESri4t7Ru2PHdykn2_lJm6yxE_QejQVUZP1ROdPqEnd6KenfqyHrYAtU8Vori8WyElUTu_3AjAPe6egZIyK6FuO_yRlJU8/3.%20Chose%20to%20apply%20this%20to%20all%20AD%20integrated%20zones.jpg?psid=1

    .

    4.
    https://qis15w.sn2.livefilestore.com/y1pXZk5kHkkl6EvfrcSprvdxp80i2WdPYaOy5M6uo98Gj5t1Heop_AR2cWXXaCof3yxQ6ORbxUBVAT1C_iDc9hUuymzdwZy2psz/4.%20%20You%20can%20see%20when%20scavenging%20will%20kick%20in%20-%201%20day%20after%20the%207%20day%20No-refresh%20and%207%20day%20Refresh%20period.jpg?psid=1

    .

    5.
    https://qis15w.sn2.livefilestore.com/y1pZdhGtBL_KWnpNMUTcSDkQWF21Ws8y_pkGvfQIZIp4GrHesAv-vl2uyrIhMu2MYm-3SyBa566R_ymHa9ja_ORyEce-cd2U09U/5.%20Set%20aging%20on%20contoso.com%20zone.jpg?psid=1

    .

    6.
    https://qis15w.sn2.livefilestore.com/y1pkkRp01cx-ArzkC6hZ9SW1L2QwKOYK6lWRN5hE0NywrwCKD4a3fNTiwKuWLDIAoM9x0pCK3Z1b5tEZYVICF9qOoSecKMytReK/6.%20DNS%20Server%20Properties%2C%20Advanced%20Tab%2C%20Checked%20Enable%20Automatic%20Scavenging%20of%20stale%20records.%20This%20basically%20turns%20it%20on.jpg?psid=1

    .

    7.
    https://qis15w.sn2.livefilestore.com/y1pInNfBbD8vssqF85PS8-Sgg-60yXVzmxA910iEz_yS2NlY5b8rRUJrr-KlP9dO79XdRksQvHmlrFCNz4FRWAjZmUDNjmguTq9/7.%20Ran%20dnscmd%20ageallrecords.jpg?psid=1

    Note of Caution: T\the only problem with running this command, is it will timestamp all static records making them eligible for scavenging. Therefore, you may NOT want to do this.

    .

    8.
    https://qis15w.sn2.livefilestore.com/y1pPWlVIC7sDUQkjxinOJhT0nEGJRi4Y_Gctkg_inp2g3ZiMJMSLM16uz_e7GQPEJ7zFqnx2T03n0eRnyZuF8m3Dudp0kdAPQfG/8.%20Restarted%20DNS%20%20although%20this%20is%20not%20necessary.jpg?psid=1

    .

    9.
    https://qis15w.sn2.livefilestore.com/y1pD3XxvDENwxCwEzOVPbngly9Hb29y3Dq1esQItYpXWif5wiBfdBDn19r-O1lGYzGYApi8gEjCb83BvJP9JRXCCXeW-tjzTZUQ/9.%20NYC-DC1%20still%20shows%20as%20static.jpg?psid=1

    Note on the screenshot below (quoted from Don’t Be Afraid of Scavening. You must be patient)::
    “The Scavenging Period is how often this particular server will attempt to scavenge. When a server scavenges it will log a DNS event 2501 to indicate how many records were scavenged. An event 2502 will be logged if no records were scavenged. Only one server is required to scavenge since the zone data is replicated to all servers hosting the zone.

    Tip: You can tell exactly when a server will attempt to scavenge by taking the timestamp on the most recent EventID 2501 & Event ID 2502 events and adding the Scavenging period to it.

    Image from: http://blogs.technet.com/blogfiles/networking/WindowsLiveWriter/DNSscavengingiseasy.Havingpatienceishar_C6E0/image_14.png

    .

    Moral of the story: Be Patient!!

    Back to top of page>

    =================================================================

     

    DNS Time stamp and Scavenging

    If the record was manually created, it won’t show a time stamp, however, if the record was dynamically registered, it will show a time stamp. If you manually create a record, the checkbox will not be checked to scavenge, however if it was dynamically registered, it will be checked.
    As for the server entries (such as from a DC), if you allow auto registration, which is done by default, and it gets scavenged, it gets re-registered anyway by the DC’s Netlogon service (for the SRV, LdapIpAddress and GcIpAddress records) and the operating system (for the A and PTR records). Unless you are seeing something going on that is affecting your environment, the default settings work fine, at least they do for me for all of my customers and installations I’ve worked in that I’ve set scavenging and forced DHCP to own the records so it can update the records it had registered at lease refresh time.

    Regarding the Active Directory dnsTombstoned Attribute

    DNS Scavenging internals (or what is the dnsTombstoned attribute) for AD Integrated zones
    Discuss the internal processing of DNS Scavenging.
    http://blogs.technet.com/b/isrpfeplat/archive/2010/09/23/dns-scavenging-internals-or-what-is-the-dnstombstoned-attribute-for-ad-integrated-zones-dstombstoneinterval-dnstombstoned.aspx

    dnsTombstoned Records clean-up:
    Everyday at 2AM (non-configurable) the DNS server scans all DNS integrated zones in AD and determines whether the tombstoned record is ready to be deleted. The default retention time of the tombstoned records is 7 days. This value can be changed by the DsTombStoneinterval value (dnscmd w2k8r2dc01 /config /DsTombstoneInterval value) or by editing the registry under HKLM\CCS\Services\DNS\Parameters Value Name:DsTombstoneInterval

    Value Type: DWORD). The value is in seconds.

    At that point the DNS deletes the record.

    Back to top of page>

    =================================================================

     

    Scavenging Refresh and No Refresh Settings Must be less than the DHCP Lease Period

    The scavenging period must be set less than the lease time. The way you have it currently set, you have two different settings but both are beyond the lease time. Due to both of these settings being different and beyond the lease time, is why you are getting inconsistencies, as I previously mentioned.

    For example: The 7 and 7 day intervals work hand in hand with a default DHCP lease time of 8 days. DHCP renewals are half the lease interval right, whcih is 4 days. If it doesn’t get renewed, then it waits until 87.5% of the lease time to renew, which is at the 7th day. If it doesn’t get renewed, then the lease is lost, and the DHCP client will attempt to get a new lease. Once the lease is lost at the 7th day, then if you left scavenging set to default, it will clean out that old lease entry from DNS in all zones it existed in.

    Therefore, if you have an 8 hour lease, you’ll need to set scavenging for 1 day, but that is not a recommended setting. It’s simply too low. Also an 8 hour lease tries to renew at 50% of the lease time, and if unsuccessful, at 87.5% of the lease time, which is at the 7th hour. Scavenging needs to be set below that, but scavenging settings are in days, which is at 24 hours intervals, so there’s no possible way to set it below the lease time.

    Also, a lease time of 8 hours, or even 4 hours, as I’ve heard some admins have set it to, is really an aggressively short lease and can cause other problems elsewhere, such as with WINS and replication partners. I’ve seen errors in WINS in a partnership scenario where the data is constantly changing and WINS simply couldn’t keep up with the changes between partners.

    My suggestion is at least that if you want to keep an aggressively short lease, to at least make the lease period 2 days and scavenging 1 day.

    However, I’ve been in environments with the default 8 day lease and 7 day scavenging settings, along setting either using credentials so DHCP owns all records it updates, or using the DnsProxyUpdate group, and it works fine. If a laptop gets a record at 8am on a Monday, but unplugs and goes home and comes back on Thursday, the laptops will attempt to get the same lease. If the laptop doesn’t come back until Tuesday the following week, it will get a new lease and new IP, since DHCP owns the record, it simply updates it in DNS for the forward and reverse zones.

    To properly make it work using the DnsProxyUpdate group or using credentials, you must force DHCP to update ALL RECORDS, whether the client knows how to update or not or requests it or not (the bottom setting). This will force DHCP to own ALL records. If you do not set these settings, and the scavenging period is more than the lease, unexpected results will occur.

    Scenario: Choosing a Short DHCP Lease Time of 8 hours

    If you reduce the DHCP lease to 8 hours, a number of things can occur, such as increased AD Tombstoning of DNS entries, which will increase the AD NTDS.dit file size, as well as possibly an inconsistency with the records in DNS, as well as issues with WINS trying to keep up with the changes, which will be evident with WINS Event log error entries.

    Also keep in mind, with any DHCP client no matter what operating system, uses the DORA method, that is Discovery, Offer, Request, and Acknowledgement. The point in time a client will ask for a lease refresh is at the 50% mark, where it uses RA, or Request (for the current lease config it has), and Acknowledgment. If it can’t get it at the 50% mark after 3 attempts, it will wait until 7/8 of the lease time to broadcast out a refresh request until the end of the lease period. If it doesn’t get a renewal at the end of lease, the client machine removes the current config from its interface and has no IP.

    Therefore with an 8 hour lease, the refresh time is at 4 hours. That needs to be taken into account with additional traffic, and how DNS updates, as well as how WINS handles it with the constant requests coming through.

    Regarding the WINS issue, I’ve seen this once at a customer site years ago. It’s always stuck to the back of my mind to keep this in mind when such a short lease is desired. I found  a default lease works fine, as long as scavenging is enabled (using default settings as well), including if the DHCP server is on a DC, adding the DHCP server to the DnsUpdateProxy group, or to alleviate the security issues with such as move, to rather supplying credentials for DHCP, so it owns all records it registers into DNS, in order so it can update the records as they change. Otherwise, expect issues to occur.

    (The following, which goes into much more detail of what is actually occuring, was compiled and posted by Chris Dent in the Microsoft DNS newsgroup.)


    Why would one choose 8 hours? Possibly to handle many laptops coming in and out of the network. So you would think a shorter lease time would work. However, keep in mind with any lease time, the point at which a client will ask for a lease refresh is at 50% of the lease time. Therefore, the client machine will asking for a refresh every four hours.

    This will result in a high rate of change in DNS, which may lead to a large number of tombstoned DNS entries. It would seem reasonable to reconsider the DHCP Lease duration, 8 hours is, after all, extremely short.

    Essentially you have:

    • The amount of AD Tombstoned Data is increasing because of Stale DNS records
    • The number of Stale DNS Records is high because of the (potential) rate of change of records in both Forward and Reverse Lookup
    • The rate of change must be somewhat proportional to changing leases in DHCP

    The DNS Record lifecycle:

    1. An A record is created (as a dnsNode in AD).
    2. When the Timestamp is no longer updated, and the Aging Intervals passes it’s aged setting, the A Record becomes Stale.
    3. Stale Records are removed from the active DNS system, and the AD dnsTombstoned attribute is set to TRUE.
    4. Tombstoned record exists for value of the DsTombstoneInterval attribute, which is 7 days by default.
    5. The DnsNode object is moved to the Deleted Objects for the length of time of the tombstoneLifetime attribute value.

    Note : The Active Directory Tombstone Lifetime is listed in the schema.ini and will be set during the promotion of the very first DC in the forest based on the Windows version used to install the first DC. This value does not change after upgrading all domain controllers to newer Windows versions or by changing the Domain or Forest Functional Levels. The entry in the schema.ini “tombstoneLifetime=<number of days>”  and can be changed. Therefore, this will tell you what the value is depending on what Windows operating system was used to install the very first domain controller in your infrastructure:

    • If the very first DC was installed using a Windows 2003 with integrated SP1 CD or newer, the Tombstone Lifetime Value is 120 days.
    • If the very first DC installed in the forest is Windows 2000 (any Service Pack), or Windows 2003 (pre-Windows 2003 SP1), the Tombstone LIfetime is 60 days.

    The values can be changed. Please read the following for information on how to change it:

    Active Directory Lingering Objects, Journal Wraps, Tombstone Lifetime, and Event IDs 13568, 13508, 1388, 1988, 2042, 2023
    (Scroll down to “Active Directory Tombstone Lifetime”)
    http://msmvps.com/blogs/acefekay/archive/2011/12/27/active-directory-lingering-objects-journal-wraps-tombstone-lifetime-and-event-ids-13568-13508-1388-1988-2042-2023.aspx

    Therefore, you either need to reduce the rate of change by increasing the lease duration, or deal with the inaccuracy in DNS, by limiting the Aging and Scavenging settings, or deal with an increasing directory size to store all this additional data. The directory size should level out eventually, when you reach the point where the number of tombstoned records being flushed is equal to the number being created.

    Back to top of page>

    DHCP Conflict Detection

    When DHCP provides a lease to a client, it tries to determine if there are no conflicts with another machine using the IP, which may have been inadvertently configured with a static IP configuration not realizing the IP is withing the Lease Scope.

    DHCP uses pings for conflict detection.

    Enable address conflict detection
    http://technet.microsoft.com/en-us/library/cc737924(WS.10).aspx

    DHCP Best Practices
    Look for: “Use server-side conflict detection on DHCP servers only when it is needed”
    http://technet.microsoft.com/en-us/library/cc780311(WS.10).aspx

    DHCP Server Conflict Detection
    http://technet.microsoft.com/en-us/library/cc958918.aspx

    I’ve been asked a few times in the past if DHCP Conflict detection pings are the same as the pings when one uses a command prompt to ping a host. The answer to that is yes.

    To expand, the term “ping” is short for “Packet Internet Groper.” Pings are based on ICMP packets, just as you would ping an IP address, the DHCP server does the same to detect conflicts. It’s sumamrized in the following link by searching the sentence, “When conflict detection attempts are set, the DHCP server uses the Packet Internet Groper (ping) process …”

    DHCP Server Conflict Detection
    http://technet.microsoft.com/en-us/library/cc958918.aspx

    Specific info on the Ping command:

    Ping – General Summary
    http://en.wikipedia.org/wiki/Ping

    Internet Control Message Protocol – Technical Summary
    http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol

    Back to top of page>

    =================================================================

     

    DHCP Lease has a “pen” or “pencil” Icon

    If a record shows up in the DHCP Lease list with a pen icon, it means that a write is pending. If it doesn’t disappear, it may mean it is trying to register into a zone that does not exist on the DNS servers. This happens in cases where the client machine is not joined to the domain and has a missing or different Primary DNS Suffix than the zone in DNS.

    Registration can only occur into a zone that exists on DNS and that zone updates have been configured to allow updates.

    If this is the case, go into the client machine’s IP properties, and perform the following:

    • On the DNS tab in TCP/IP Advanced properties, clear the “Register this connection’s addresses in DNS”
    • Clear the  “Use this connection’s DNS suffix in DNS registration” check boxes,
    • The DHCP Server will fill these in for you and register using the domain name in Option 015.

    Reference:

    DHCP console icons reference
    http://technet.microsoft.com/en-us/library/cc784812(WS.10).aspx

    Back to top of page>

    =================================================================

     

    Records & timestamps, and the lack of timestamps

    If the record was manually created, it won’t show a time stamp, however, if the record was dynamically registered, it will show a time stamp. My guess is the records you are referring to were manually created. If you manually create a record, the checkbox will not be checked to scavenge, however if it was dynamically registered, it will be checked.

    I just tested this with Windows 2003 DNS. When I had built a few servers for a customer and let them auto register, they had a timestamp and the scavenge checkbox was checked. For the records I manually created, such as internal www records, and others, they did not have a time stamp and were not checked to scavenge.

    Even if you allow auto registration, which I do by default, and it gets scavenged, it gets re-registered anyway by the OS. Unless you are seeing something going on that is affecting your environment, the default settings work fine, at least they do for me for all of my customers and installations I’ve worked in that I’ve set scavenging and forced DHCP to own the records so it can update the records it had registered at lease refresh time.

    Back to top of page>

    Related Links

    How to configure DNS dynamic updates in Windows Server 2003.
    http://support.microsoft.com/kb/816592

    Using DNS servers with DHCP (Contains information on the DnsUpdateProxy group and its usage)
    http://technet.microsoft.com/en-us/library/cc787034 (WS.10).aspx

    Using DNS Aging and Scavenging
    Aging and scavenging of stale resource records are features of Domain Name System (DNS) that are available when you deploy your server with primary zones.
    http://technet.microsoft.com/en-us/library/cc757041(WS.10).aspx

    Microsoft Enterprise Networking Team : Don’t be afraid of DNS, Mar 19, 2008
    DNS Scavenging is a great answer to a problem that has been nagging everyone since RFC 2136 came out way back in 1997.
    http://blogs.technet.com/networking/archive/2008/03/19/don-t-be-afraid-of-dns-scavenging-just-be- patient.aspx

    How DHCP Technology Works
    http://technet.microsoft.com/en-us/library/cc780760(WS.10).aspx

    From Ulf B. Simon Weidner:
    DHCP, DNS and the DNSUpdateProxy-Group
    I had a discussion in the Newsgroups lately about DHCP and the DNSUpdateProxy-Group which is used to write unsecured DNS-Entries to a DNS-Zone which only …
    http://msmvps.com/ulfbsimonweidner/archive/2004/11/15/19325.aspx

    And from Kevin Goodnecht:
    Setting up DHCP for DNS registrations
    http://support.wftx.us/setting_up_dhcp_for_dns_registra.htm

    317590 – HOW TO Configure DNS Dynamic Update in Windows 2000 and DNSUpdateProxy Group:
    http://support.microsoft.com/kb=317590

    816592 – How to configure DNS dynamic updates in Windows Server 2003:
    http://support.microsoft.com/kb/816592

    Follow up discussion on the DNSUpdateProxy-Group:
    http://msmvps.com/ulfbsimonweidner/archive/2005/03/26/39841.aspx
    ==================================================================

    Back to top of page>

     

    More to come… Comments are welcomed.

    ==================================================================

    Summary

    I hope this helps!

    Published 8/13/2016

    Ace Fekay
    MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP – Directory Services

    clip_image002622[2][2][2] clip_image004622[2][2][2] clip_image006622[2][2][2] clip_image008622[2][2][2] clip_image010622[2][2][2] clip_image012622[2][2][2]

    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php

    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

    Migrate Files to a new File Server using RoboCopy, IP addresses, and Relative Paths using the Administrative Shares

    Prologue

    Ace Fekay here again.

    You might say to yourself this is some really simple stuff. Sure, it might be, for the pro. As many of you know, I’m an avid Active Directory and Exchange server engineer/architect, and an MVP in Active Directory.

    Therefore with AD, Exchange, and Office 365, you will find that scripting comes into play more and more with your daily tasks.  The main reason I’m posting simple scripts is that to get the job done, I just needed an arsenal of simple quickie scripts when called upon a simple task, such as this one, when tasked to quickly get a list of users in a group.

    I hope this, and my future scripts, especially with Office 365, help you out.

    Scope

    This is one method to migrate data from one file server to another. I have one method that I will post later, that does it by the share names. This is to just get the two closer to having the same data before I run the final script.

    DFS

    Keep in mind, we use DFS. I will already have created a new target to the new file server for the current share, but keep the new targets disabled until ready to cut over.

    However, when we cut over the target to the new server, we would like to shut off the shares on the source (old) server, to prevent anyone from using it. Of course, we’ve already communicated to the user base the migration schedule.

    Therefore, since the shares will be deleted, we must rely on running this by using IP addresses and relative paths from the default administrative shares (c$, d$, etc).

    Share and NTFS Permissions Backup

    Yes, absolutely! You definitely want to back up your Share and NTFS permissions on this server just in case something happens! The following link is a great article to show you how to do it:

    How to Back Up and Restore NTFS and Share Permissions
    http://blogs.technet.com/b/askds/archive/2008/11/24/how-to-back-up-and-restore-ntfs-and-share-permissions.aspx

    Easy? Nah…

    Many may say this is simple stuff. Sure, for the seasoned scripter, which I’m not, The main reason I’m posting this, and I will be posting much more, including Office 365 scripts, is that I had to look it up. I’ve found various websites that provide how-tos, but when it comes to handling variables and piping, I’ve found there is no one place to get various examples and have found myself looking at multiple places to get this info, including my colleagues, who are extremely adept at scripting. With many place, I also see elaborate scripts that do more than what I need. They are fabulous blogs and websites, but sometimes I need the simple one-liners to perform day to day stuff.

    Script:

    /

    # Uses relative paths
    # Make sure you change directory to where your script is located on the computer you are running this before running
    #
    # =========================================================================================
    #Function: Get the Total Size of Folder

    function Get-Size
    {
         param([string]$pth)
         “{0:n2}” -f ((gci -path $pth -recurse | measure-object -property length -sum).sum /1mb) + ” mb”
    }
    # =========================================================================================
    #
    cd “C:\PSScripts\OldServerName”

    $SourceServerNetBIOSName =     “OldServerName”
    $SourceServerIP =         “10.100.200.200”
    $DestinationServerName =     “NewFileServer.contoso.com”

    #**************************************************************************************
    #Ignore this section
    #Test files with only one share

    #Note: This section was a test to see if I can get this script to work if there is only one share.
    #I could not get it to work with one share. The reason is there must be two (2) or more shares for
    #this to work, because I’m using an array. There is no such thing as a single array.

    #$SourceServerPath =            @()
    #$SourceServerShares =          @()
    #$DestinationServerShareNames = @()

    #$SourceServerPath =            Get-Content ‘.\OldServerName-Share-paths-test.txt’
    #$SourceServerShares =          Get-Content ‘.\OldServerName-SourceSharesList-test.txt’
    #$DestinationServerShareNames = Get-Content ‘.\OldServerName-DestinationSharesList-test.txt’

    #Ignore this section
    #**************************************************************************************

    $SourceServerPath =            Get-Content ‘.\OldServerName-Share-paths.txt’
    $SourceServerShares =          Get-Content ‘.\OldServerName-SourceSharesList.txt’
    $DestinationServerShareNames = Get-Content ‘.\OldServerName-DestinationSharesList.txt’

    $LogDestinationFolder = “.\Logs”
    $LogfileName = $SourceServerNetBIOSName+”.txt”
    $LogFileAndPath = $LogDestinationFolder+”\”+$LogfileName

    # Checks for existence of a directory for log files if not, one gets created.
    If (!(Test-Path -Path $LogDestinationFolder)){
        New-Item -ItemType directory -Path $LogDestinationFolder
    }

    write-host “Total Share count = ” $SourceServerShares.count

    for ($i = 0; $i -lt $SourceServerShares.count; $i++){

        $srcpath = $SourceServerPath[$i] -replace ‘(.*):’,’$1$’
        #$srcpath = $SourceServerPath -replace ‘(.*):’,’$1$’
        $dstpath = $DestinationServerShareNames[$i]

        $FullSourcePath = “\\”+$SourceServerIP+”\”+$srcpath
        $FullDestPath = “\\”+$DestinationServerName+”\”+$dstpath

        write-host “”
       
        if ((Test-Path $FullSourcePath) -and (Test-Path $FullDestPath))
        {
            $log = $LogDestinationFolder + “\” + $SourceServerNetBIOSName + “-” + $SourceServerShares[$i] +”.txt”
            write-host “Current share’s log:” $Log
           
            robocopy $FullSourcePath $FullDestPath /E /R:1 /W:1 /TEE /log:$log | Out-String

        #This is trying different switches – Ignore
            #robocopy $FullSourcePath $FullDestPath /MIR /copy:DT /W:5 /R:1 /V /IT /FP /NFL /TS  /log:$log | Out-String

        #This was a local drive to drive attempt – Ignore
        #robocopy e:\users y: /copy:DATSO /E /R:1 /W5 /TEE /log:c:\robocopy.log

        write-host “Source path is: ” $srcpath
            write-host “Full Source Path is: ” $FullSourcePath
        write-host “Destination path is:” $dstpath
            write-host “Full Destination path is: ” $FullDestPath

            $SharesProcessedSoFar = $i + 1
            write-host “Shares processed so far =” $SharesProcessedSoFar ” out of a total share count of ” $SourceServerShares.count
            write-host “”
            Write-Host “”
        }

        else

        {
            write-host “Problem with: ”           $srcpath         “Destination sharename is:”     $dstpath
            write-host “Referencing full Source Path:” $FullSourcePath  “Destination Path:”         $FullDestPath
            $SharesProcessedSoFar = $i + 1
            write-host “Shares processed so far =” $SharesProcessedSoFar ” out of a total share count of ” $SourceServerShares.count
        }
    }
    write-host “Total Shares processed = ” $SourceServerShares.count

    More to come…

    Comments are welcomed.

    ==================================================================

    Summary

    I hope this helps!

    Published 10/3/2015

    Ace Fekay
    MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP – Directory Services

    clip_image002622[2][2] clip_image004622[2][2] clip_image006622[2][2] clip_image008622[2][2] clip_image010622[2][2] clip_image012622[2][2]

    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php

    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

    Get-QADGroupMember to CSV

    Prologue

    Ace Fekay here again.

    You might say to yourself this is some really simple stuff. Sure, it might be, for the pro. As many of you know, I’m an avid Active Directory and Exchange server engineer/architect, and an MVP in Active Directory.

    Therefore with AD, Exchange, and Office 365, you will find that scripting comes into play more and more with your daily tasks.  The main reason I’m posting simple scripts is that to get the job done, I just needed an arsenal of simple quickie scripts when called upon a simple task, such as this one, when tasked to quickly get a list of users in a group.

    I hope this, and my future scripts, especially with Office 365, help you out.

    Scope

    I needed to get a user membership list from a global group called, “Marketing Dept,” into a CSV. Group scope doesn’t matter. I just need a list of the members because the share owner that the group is controlling access, needed a list to ensure that it’s current and to clean up any disabled accounts from users that have left the company.

    And yes, this is simple stuff. The main reason I’m posting this, and I will be posting much more, including Office 365 scripts, is that I had to look it up and there is no one place to get all of this at the simple level. All I see are elaborate scripts that do more than what I needed. Hence, my posts.

     

    I usually kick it off with a get-credential because I run this from my workstation logged on with my non-admin account. And because I work in a multi-forest, multi domain environment, I must connect to the specific domain where the group exists.

    Of course, we must add the PS Quest snap-in. In addition, I use the “-NoTypeInformation” switch to suppress the silly “Type” data that shows up in the output.

    Code

    get-credential
    add-pssnapin Quest*
    connect-qadservice domain2
    Get-QADGroupMember “Marketing Dept” | Select-Object DisplayName,Name,AccountIsDisabled | Export-Csv c:\output\Domain2-MarketinDept.csv –NoTypeInformation

    Comments are welcomed.

    ==================================================================

    Summary

    I hope this helps!

    Published 8/17/2015

    Ace Fekay
    MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP – Directory Services

    clip_image00262 clip_image00462 clip_image00662 clip_image00862 clip_image01062 clip_image01262 clip_image01462

    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php

    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

    PowerShell: Getting AD groups of one User and Add them to a List of Other Users

    Prologue

    Ace here again. Yep, me again. I’ve been on the sidelines lately with a big mail migration, then changed roles to the AD and Windows management side of things.

    Part of what I do is perform necessary file maintenance (FSRM, DFS, fileserver migration, etc.), and of course, respond to tickets for requests or issues.

    One request that came in was for 16 new users that are to have identical group memberships as a current user. I looked at the group membership of the user in question and saw he was part of 11 or 12 groups. Hmm, and he wants this done for 16 users? I could sit there and add group to each user one at a time. Nah, too much work.

    So I thought to try to do it programmatically, because who knows when this will come up again.

    Script

    It’s pretty straight forward.

    #===========================================================================================
    # This was created for a ticket request to mimic one user, SomeSamAccountUsername, group membership to add to a list of user accounts.
    # By Ace Fekay 7/15/2015
    #
    # First, get a memberOf for SomeSamAccountUsername and save it to a file called c:\PSScripts\SomeSamAccountUsername-grouplist.txt
    #     Run Get-QADMemberOf SomeSamAccountUsername
    #
    #     Copy and paste the output from the screen to the file
    #     In the file, keep the DN values and delete everything else.
    #
    # Second, get a list of the user accounts that you want adjusted from the ticket owner
    #     Then save the list in another text file called c:\PSscripts\Usernames.txt
    #     Prefix the user accounts with the domain name, such as philly\username
    #
    # Third, read the first user in the list, then add the groups to that user, then read the next user in the list, repeat.
    #===========================================================================================

    # The next line adds all of the Quest tools.

    Add-PSSnapIn Quest *
    Get-QADMemberOf SomeSamAccountUsername

    #===========================================================================================
    # Sample output from Get-QADMemberOf SomeSamAccountUsername:
    #===========================================================================================
    #
    #Name                           Type            DN                                                                                                            
    ##
    #Domain Users                   group           CN=Domain Users,OU=IT,DC=philly,DC=contoso,DC=com                                                       
    #Deployment Technician          group           CN=Deployment Technician,OU=IT,DC=philly,DC=contoso,DC=com                                         
    #Desktop-Technician             group           CN=Desktop-Technician,OU=IT,DC=philly,DC=contoso,DC=com                                                     
    #AddComputerToDomain            group           CN=AddComputerToDomain,OU=IT,DC=philly,DC=contoso,DC=com                                               
    #Vendor-A-contractors           group           CN=Vendor-A-contractors,OU=IT,DC=philly,DC=contoso,DC=com                                               
    #General-Group                  group           CN=General-Group,OU=IT,DC=philly,DC=contoso,DC=com                                                            
    #Wireless-Users                 group           CN=Wireless-Users,OU=IT,DC=philly,DC=contoso,DC=com                                                
    #Group-B                        group           CN=Group-B,OU=IT,DC=philly,DC=contoso,DC=com                                                                
    #IT-Staff                       group           CN=IT-Staff,OU=IT,DC=philly,DC=contoso,DC=com                                                      
    #IT-Admins                      group           CN=IT-Admins,OU=IT,DC=philly,DC=contoso,DC=com                                                     
    #IT-Technicians                 group           CN=IT-Technicianss,OU=IT,DC=philly,DC=contoso,DC=com                                                   
    #Client-Support                 group           CN=Client-Support,OU=IT,DC=philly,DC=contoso,DC=com   

    # #=================================================================================================
    # Sample of what C:\PSScripts\groupmembership\SomeSamAccountUsername-grouplist.txt  will look like:
    # #=================================================================================================
    # CN=Domain Users,OU=IT,DC=philly,DC=contoso,DC=com                                                       
    # CN=Deployment Technician,OU=IT,DC=philly,DC=contoso,DC=com                                         
    # CN=Desktop-Technician,OU=IT,DC=philly,DC=contoso,DC=com                                                     
    # CN=AddComputerToDomain,OU=IT,DC=philly,DC=contoso,DC=com                                               
    # CN=Vendor-A-contractors,OU=IT,DC=philly,DC=contoso,DC=com                                               
    # CN=General-Group,OU=IT,DC=philly,DC=contoso,DC=com                                                            
    # CN=Wireless-Users,OU=IT,DC=philly,DC=contoso,DC=com                                                
    # CN=Group-B,OU=IT,DC=philly,DC=contoso,DC=com                                                                
    # CN=IT-Staff,OU=IT,DC=philly,DC=contoso,DC=com                                                      
    # CN=IT-Admins,OU=IT,DC=philly,DC=contoso,DC=com                                                     
    # CN=IT-Technicians,OU=IT,DC=philly,DC=contoso,DC=com                                                   
    # CN=Client-Support,OU=IT,DC=philly,DC=contoso,DC=com  
    #=================================================================================================

    #===========================================================================================
    # Sample of what C:\PSScripts\groupmembership\List-Of-Usernames.txt username list will look like:
    #==========================================================================================
    # philly\username1
    # philly\username2
    # philly\username3
    # philly\username4
    # philly\username5
    # philly\username6
    # philly\username7
    # philly\username8
    # philly\username9
    # philly\username10
    # philly\username11
    # philly\username12
    # philly\username13
    # philly\username14
    # philly\username15
    # philly\username16
    #==========================================================================================

    $GroupList = get-content C:\PSScripts\groupmembership\SomeSamAccountUsername-grouplist.txt 
    $UsernameList = get-content C:\PSScripts\groupmembership\List-Of-Usernames.txt

    # Now pull in each user one a time:
    Foreach ($Username in $UsernameList)
    {
     
    # Now pull in each group one at a time and add them to the user
       Foreach ($Group in $GroupList)
      
    # Add the group to the user 
        {
        Add-QADGroupMember  -Identity $Group -Member $Username
       
    # Write out on the screen what username is and what group they were added to:
        write-host $Username “has been added to ” $Group
       
    # Repeat for next group until all groups are done.
       }
      
    # Repeat for the next user
    }
    #===========================================================================================
    # That’s it!
    #===========================================================================================

     

     

    Summary

    I hope this helps!

    Published 7/27/2015

    Ace Fekay
    MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP – Directory Services

    clip_image00262 clip_image00462 clip_image00662 clip_image00862 clip_image01062 clip_image01262 clip_image01462

    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php

    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

    Delegate Permissions for an OU in Active Directory Users and Computers (ADUC) & Create a Custom MMC, or Just Use RSAT

    Updated 9/20/2016

    Note- this was put together and fast published and there may be errors. Check back for updates when I add RSAT info.

    Prologue

    Ace here again. Yep, me again. This scenario comes up time to time. Sure, you can use the RSAT tools, but here an old fashioned, truly tried method that works nicely so a delegated OU admin can only see and do what they need to do in their OU.

    Scope

    After you Delegate Permissions in to a limited admin in Active Directory, such as the ability to reset passwords, you may want to create a custom ADUC MMC (console or custom taskpad)  for the delegated admin to control the portion of AD (the OU) they are allowed or delegated in.

    For Windows 2003 AD – but it will work in 2008 and newer

    The last time I set this up for a customer, involved a snap-in for each ‘location’ OU, I allowed to retain the rt-click context, and the tree view available in the custom console (left pane and right pane), but I removed everything else including the file menu buttons and such. So under View, Customize, uncheck everything except the top one that says Console Tree. This way they can’t go up level or click any of the things in there. But they will have the right-click feature.
     
    You can also choose to remove the left hand pane (tree view).

    MMC v2 and v3 are the same:

    • Start/run/mmc, hit enter
    • File, Add-Remove Snap-in, Add ADUC
    • Drill down under the domain to the OU you want.
    • Right-click on that OU, choose new window from here.
    • A new window pops up with the OU in the left pane and the contents in the right pane.
    • Close the original ADUC window leaving the new window open that you’ve just created.
    • Expand the window to take up the whole console. – This will keep them in this section and they will not be able to go up levels and are ‘stuck’ in this OU.
    • Select View/Customize
    • Uncheck everything but Console Tree.
    • File/Options Choose Console Mode, then select:

    User mode: Limited Access single window
    Check: Do not Save Changes to this console
    Uncheck: Allow the user to customize views
    Save it.

    • Logon as a test user that was delegated permissions and test it.

    If you want to eliminate the ability for the delegated admin to right-click on a user account, uncheck the Console Tree above, then change the console view by right-clicking on the OU, choose New Task View, and choose a vertical or horizontal list, then choose to create a new task, menu command, highlight a user account, choose reset password, or anything else in the right column, choose an icon, and finish.

    Copy the .MSC file via a UNC connected to the delegated person’s XP workstation’s \Documents and Settings\username\desktop folder, or if Windows Vista or newer, in the C:\users\username\desktop folder.

    Keep in mind, the Active Directory Administration Center, RSAT tools or AdminPak tools, depending on what operating system version the client side is, needs to be installed on the workstation for the ADUC binaries to be available for this task pad to work.

     

    For Windows 2003/Windows XP using the AdminPak tools just for the ADUC snap-in, nothing else:

    Copy over the following three DLLS from the 2003 or newer DC you are on, to their client’s system32 folder. All three of these are needed on a 2003 DC or newer, or the ADUC won’t open. However, on an XP or newer machine, you only need two. If I were to allow users to change passwords and create a custom MMC for just that OU, then all I need is adprop.dll and dsadmin.dll, otherwise you need all three.

    • adprop.dll (for object properties)
    • dsadmin.dll (ability to alter object properties)
    • dsprop.dll (for object properties related to directory services)

    Then you can use PSEXEC (one of the PSTools available free at Microsoft) to remotely register the DLLs listed below on their workstation using the regsrv32.exe utility.
    Download PsExec v1.98, by By Mark Russinovich, Published: April 28, 2009
    http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

    • psexec \\machinename regsvr32 adprop.dll
    • psexec \\machinename regsvr32 dsadmin.dll
    • psexec \\machinename regsvr32 dsprop.dll

    Here are some screenshots at the following link:

    Create Taskpads for Active Directory Operations:
    http://www.petri.co.il/create_taskpads_for_ad_operations.htm

    ===============================================

    For AD on Windows 2008 and newer:

    You can use the ADAC & RSAT Tools, or you can use the above method.
    Note: ADAC does not have a feature to break down specific tools to create a custom console as shown above.

    For the Active Directory Administration Center and the RSAT tools:

    For the Related links below for the new AD Admin Center. However, the Admin Center does not have the feature to break down just specific tools to create a custom console as shown above.

    Active Directory Administration Center (ADAC):

    Active Directory Administrative Center: Getting Started
    http://technet.microsoft.com/en-us/library/dd560651(WS.10).aspx

    Active Directory Administrative Center —  the New AD interface
    http://techibee.com/active-directory/active-directory-administrative-center-a-new-ad-interface-for-win7-and-win-2008/290

    Learn New Features in Active Directory Administrative Center
    http://www.enterprisenetworkingplanet.com/windows/article.php/3887136/Learn-New-Features-in-Active-Directory-Administrative-Center.htm

    Remote Server Administration Tools (RSAT) for Windows operating systems (Discusses how to install it for all versions of Windows)
    https://support.microsoft.com/en-us/kb/2693643

    Remote Server Administration Tools for Windows 10
    https://www.microsoft.com/en-us/download/details.aspx?id=45520 

    Customizing – Installing Remote Server Administration Tools (RSAT) for Windows 7
    http://www.petri.co.il/remote-server-administration-tools-for-windows-7.htm

    Remotely managing your Server Core using RSAT
    http://blogs.dirteam.com/blogs/sanderberkouwer/archive/2008/04/27/remotely-managing-your-server-core-using-rsat.aspx
    ==================================================================

    Summary

    I hope this helps!

    Last updated – 2/2006, updated 9/20/2016

    Ace Fekay
    MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP – Directory Services

    clip_image002 clip_image004 clip_image006 clip_image008 clip_image010 clip_image012 clip_image014 clip_image016

    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php

    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

    OU Structures and Group Policy Objects (GPOs) Design Considerations and Guidelines

    Original posting: 8/25/2014
    Revised 5/26/2017

    Hey everyone, Ace here, again. This is an accumulation of notes on OU structures. It’s not very well laid out, but I hope it gives you some ideas on how to design an OU structure and to help with applying GPOs.

    Default Domain Policy and OU Design

    It’s suggested and recommended to not change the Default Domain Policy.
    Keep in mind, whatever you set at the domain level will flow downhill to
    everything. I would suggest to design your OU structure to reflect your
    organization and/or departments, which will also help you create GPOs for
    the OU design.

    For example, for a company with more than one location/site, I would suggest
    the following – and this is just that… a suggestion.

    Domain
    …..Philly OU
    …………..Accounting
    …………..Sales
    …………..Marketing
    …………..Desktop
    …………..Users
    …………..Groups
    …………..Laptops
    …..Seattle OU
    …………..Accounting
    …………..Sales
    …………..Marketing
    …………..Desktops
    …………..Users
    …………..Groups
    …………..Laptops

    In the above example, I separated Laptops and Desktops because I have two different Windows Update GPOs set. The Desktop Windows Update GPO I created runs at 3:00 AM, whereas the Laptop Updates run at 3:30 PM while the users have the laptops in the
    office.

    I also separated groups just to “group” them together, and for no other reason.

    This design also allows me to create GPOs for the different offices,
    or I can create one and link them to both offices. The design possibilities
    are endless, especially if you control flow with Block Inheritance, Loopback, WMI filtering, disabling the Computer or User portion of a GPO, etc., however in many cases I do not use these features because trying to support them 8 months later when there’s a problem it is difficult to remember what you had blocked, etc.

    And yes, you can use RSOP to look at what is being applied, etc., but I find it easier to simply create another OU or a child OU to have a different setting than the parent, such as the following, where I created a GPO to lock the desktop with two different time settings.

    The Desktops OU has a 30 minute setting, but I created a 15 Minute Timeout OU directly beneath it. Because the identical setting is different on the child, it overrides the parent’s setting. I can simply “look” at my OUs and know what I have applied.

    …..Seattle OU
    …………..Accounting
    …………..Sales
    …………..Marketing
    …………..Desktops
    ………………..15 Minute Timeout OU
    …………..Users
    …………..Laptops

    These are just suggestions, and you may find that it may work for you, or not. Even in a single site, I still do it this way, because it is flexible. You never know when the customer or your company may expand. If they do, simply create another OU for the new location.

    GPO Inheritance:

    There was one question that came up regarding the above example that I thought
    I would share:

    So lets say I open AD users and Computers and create a new OU named Philly OU,
    then inside this OU I create another six sub-OU such as: Accounting,Sales,Marketing, etc..

    My questions is do I need right click on each sub-OU such as Accounting,Sales,Marketing, etc…  in the GPO tab to configure the same policy settings or just enough by setting up a GPO policy in the Philly OU parent OU folder to automatically apply to all other sub-OU?
     
    The simple answer is yes, the policy will inherit or flow downhill (traverse), as long as:

    • There are no blocks or filtering not allowing it to apply to the target (user or computer).
    • No other policy has enforcement override with conflicting settings
    • Whether the GPO is targeting user accounts or computer objects, the user and computer objects must have read rights to the following attributes:
         – gpLink
         – gpOptions

    Note: The Read permissions is also important if you were to enable Loopback Processing, as well as List Object Mode on the directory, which is a form of filtering views in the ADUC and GPMC.

    Loopback processing explained:

    Loopback processing of Group Policy, explained. Sunday, 26 July 2009
    http://kudratsapaev.blogspot.co.uk/2009/07/loopback-processing-of-group-policy.html

    You can use the Loopback to apply a GPO that depend only on which computer the user logs on to, say for example if the computer object is in a different OU. It’s a feature normally used to lock down a computer that a user is on. It’s normally used with Kiosk mode, such as a self-checkout register at the grocery store, but it can be used for anything you need. More info on this feature:

    Circle Back to Loopback – Part 1
    By Jonathan Stephens, MSFT
    http://blogs.technet.com/b/askds/archive/2013/02/08/circle-back-to-loopback.aspx

    Back to the Loopback: Troubleshooting Group Policy loopback processing, Part 2
    By Jonathan Stephens, MSFT
    http://blogs.technet.com/b/askds/archive/2013/05/21/back-to-the-loopback-troubleshooting-group-policy-loopback-processing-part-2.aspx

    Loopback processing of Group Policy
    http://support.microsoft.com/kb/231287

    *

    Videos that should help understand this better:

    Video: Active Directory: Introduction to Group Policy
    Compiled From MOC 2279b Planning, Implementing & Maintaining a Microsoft Windows 2003 AD Infrastructure, Module 6, by Ace Fekay
    https://www.youtube.com/watch?v=E0qjZhMNQUY

    Active Directory: Introduction to Group Policy

    *

    Video: Introduction to Active Directory’s Logical Design
    Compiled From MOC 2279b Planning, Implementing & Maintaining a Microsoft Windows 2003 AD Infrastructure, Module 1, by Ace Fekay
    http://www.youtube.com/watch?v=TLZZ1iHMr2Q

    Introduction to Active Directory’s Logical Design

     

    References

    Dude, where’s my GPO? Using PowerShell to find all of your Group Policy links.
    “… you can easily create a report of all your Group Policy Objects (GPOs) …”
    Cool article to list out all your GPOs in one spot with PowerShell. Can be helpful with troubleshooting.
    http://blogs.technet.com/b/ashleymcglone/archive/2013/05/29/dude-where-s-my-gpo-using-powershell-to-find-all-of-your-group-policy-links.aspx

    A good discussion on GPO Design in the following thread with good info by Christoffer Andersson:
    Thread: “Building Organization Hierarchy with Active Directory” 6/2013
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/798bf766-a351-4fdb-b8f8-927ad60e1270/building-organisation-hierarchy-with-active-directory

    Reviewing OU Design Concepts, Updated: April 11, 2008
    Applies To: Windows Server 2008, Windows Server 2008 R2 (These concepts also apply to 2003):
    Quoted: “While there is no technical limit to the number of levels in your OU structure, for manageability we recommend that you limit your OU structure to a depth of no more than 10 levels. There is no technical limit to the number of OUs on each level. Note that Active Directory Domain Services (AD DS)–enabled applications might have restrictions on the number of characters used in the distinguished name (that is, the full Lightweight Directory Access Protocol (LDAP) path to the object in the directory) or on the OU depth within the hierarchy.”
    http://technet.microsoft.com/en-us/library/cc725715(v=ws.10).aspx

    Here’s a basic visual of how GPOs work, and how it would flow downhill.
    https://onedrive.live.com/?cid=0C7B9FD0852378B8&id=C7B9FD0852378B8%21237&parId=C7B9FD0852378B8%21234&o=OneUp
    image

    Design Considerations for Organizational Unit Structure and Use of Group Policy Objects
    http://technet.microsoft.com/en-us/library/cc785903.aspx

    TechNet Magazine: Group Policy
    http://technet.microsoft.com/en-us/magazine/cc135925.aspx

    Group Policy and Advanced Group Policy Management
    http://technet.microsoft.com/en-us/windowsserver/grouppolicy/default.aspx

    Win2k3 AD OU/GPO Design Discussion
    http://www.tomshardware.com/forum/190896-46-win2k3-design-discussion

    AD Scalability and GPOs
    http://technet.microsoft.com/en-us/library/cc756101.aspx

    You receive a “Failed to delete Group Policy Object” error message when you try to delete the default domain policy or the default domain controller policy in Windows Server 2003 and in Windows 2000 Server”
    “… the default domain Group Policy object (GPO) and the default domain controller Group Policy object cannot be deleted.”
    http://support.microsoft.com/kb/910201

    Default Group Policy objects become corrupted: disaster recovery
    http://technet.microsoft.com/en-us/library/cc739095(WS.10).aspx

    Chapter 4: Strengthening Domain and Domain Controller Policy Settings (applies to all operating systems)
    http://technet.microsoft.com/en-us/library/cc773205(v=WS.10).aspx

    *

    ============================================================

    Summary

    Published 5/1262017
    I hope this helps!

    Ace Fekay
    MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP – Directory Services

    clip_image0023 clip_image0043 clip_image0063 clip_image0083 clip_image0103 clip_image0123 clip_image0143 clip_image0163

    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php

    Or just search within my blogs:
    https://blogs.msmvps.com/acefekay/

    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

    Event ID 5774

     

     

    In general, these events indicates that the machine is unable to register its records with the DNS serverSleeping half-moon it’s configured.

    Possible causes:

    • An ISP’s DNS server, or the router’s IP address, is set to be used as a DNS server in NIC properties.
    • The AD zone is configured to not allow dynamic updates.
    • If the 1st DNS entry is in another site, a firewall may be blocking necessary traffic.
    • Altered default security settings on the zone.
    • Altered default security settings in AD.
    • Altered default security settings on C: drive or C:\Windows folder.
    • Antivirus not configured to allow domain communications and services exceptions. See the antivirus vendor documentation on how to configure DCs for exclusions.
    • If the zone is set to Secure Only, possible Kerberos authentication errors will prevent registration. Causes of Kerberos errors can be numerous including misconfigured time service and antivirus exclusion, using an ISP’s DNS, third party installed firewalls or AV, and more.

    Note on Firewalls

    Active Directory communications require over 29 ports to be allowed, plus the ephemeral ports, and differ among operating system versions:

    • Windows 2003, Windows XP and older: UDP 1024 – 5000
    • Windows 2008, Windows Vista, & newer: UDP 49152 – 65536

    DNS updates require TCP 53 & UDP 53, not just TCP 53.
    It can be extremely challenging to configure a firewall for AD communications/ General rule of thumb is to just allow all traffic between locations.

    Here’s a good list of the ports:

    Active Directory Firewall Ports – Let’s Try To Make This Simple (RODC, too)
    http://msmvps.com/blogs/acefekay/archive/2011/11/01/active-directory-firewall-ports-let-s-try-to-make-this-simple.aspx

    If you need to control the ports AD uses across a firewall:

    Active Directory Replication over Firewalls
    http://technet.microsoft.com/en-us/library/bb727063.aspx

    Paul Bergson’s Blog on AD Replication and Firewall Ports
    http://www.pbbergs.com/windows/articles/FirewallReplication.html
    http://www.pbbergs.com/windows/articles.htm

    Restricting Active Directory replication traffic and client RPC …Restricting Active Directory replication traffic and client RPC traffic to a … unique port, and you restart the Netlogon service on the domain controller. …
    http://support.microsoft.com/kb/224196

    How to restrict FRS replication traffic to a specific static port – How to restrict FRS replication traffic to a specific static port … Windows 2000-based domain controllers and servers use FRS to replicate system policy …
    http://support.microsoft.com/kb/319553

     

    You can run the following tests on AD to ensure there are no errors:

    • DCDIAG /V /C /D /E /s:yourDCName > c:\dcdiag.log
    • Netdiag.exe /v > c:\netdiag.log (Run only on each Windows 2003 or older DCs, not 2008 or 2008 R2)
    • repadmin.exe /showrepl dc* /verbose /all /intersite > c:\repl.txt
    • ntfrsutl ds domain.com > c:\sysvol.log

    Possible solutions:

    1. On the machine logging the above event, in their TCP/IP configuration, make sure they’re not configured for the same DNS server for both Primary and Secondary.
    2. The following registry value is incorrect: “SiteCoverage” under:    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters
          This value typically should equal the domain name.
    3. You can try to flip the zone types to reset default settings.
      1. Change the zone type from Active Directory integrated to “Standard Primary”, then stop & start DNS.
      2. Then stop & start the netlogon service on the child DC & verify that the records are registered.
      3. If verified, then change the zone type back to Active Directory integrated and verify that the DC no longer records the Event log errors when the netlogon service is stopped & started.
    4. Make sure the machine logging the above event is pointing to a DNS server that support Dynamic updates and is hosting a zone for the domain (i.e. make sure it’s not pointing to the ISPs DNS server).
    5. Verify if there is no manually created CNAME, A or other record) for the same hostname. If there is, it will prevent the DCs from dynamically registering its host and you need to remove the manually created record.
    6. In a Parent – Child delegated scenario, and Event ID 5774 was logged on the domain controllers in the child domain:
          Setup:
          On the parent DNS servers, there is a delegation for the child DNS servers. The child DNS servers have forwarders up to the parent DNS servers.
          Cause and Fix:
          On the Security tab in the delegations, check if  “Authenticated Users” is missing.
          Added “Authenticated Users” and enabled Full Control.

    References:

    Domain Controller Generates a Netlogon Error Event ID 5774
    http://support.microsoft.com/?id=284963

    A DNS Update is recorded as failed: Event ID 5774, 1196, or 1578
    This problem occurs when you use a third-party server application for DNS resolution. This includes SCCM causing false alarms, and cluster resources not initiating using a third party DNS server.
    Hotfix available for Windows Server 2008 R2 or Windows 7.
    http://support.microsoft.com/kb/977158

    Event ID: 5774 Source: NETLOGON
    http://eventid.net/display.asp?eventid=5774&eventno=353&source=NETLOGON&phase=1

    Other References:

    Technet thread: “Event 5774, NETLOGON” Friday, November 20, 2009
    http://social.technet.microsoft.com/Forums/en/winserverNIS/thread/0507f7cc-c426-439b-a0c6-d36cda2dfee8

    Technet thread: “Netlogon event 5774” Tuesday, February 01, 2011
    http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/cf5c1e9e-dccb-45e2-9f14-144f8ba1f838/

    ================================================

    Summary

    I hope this helps with figuring out and fixing an Event ID 5774. 

    Ace Fekay
    MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP – Directory Services
    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php

    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

    Configuring the Windows Time Service in an Active Directory Forest – A step by step with a Contingency Plan

    Published 4/2014

    Original blog post reference:
    Configuring the Windows Time Service in an Active Directory Forest – A step by step with a Contingency Plan
    https://blogs.msmvps.com/acefekay/2014/04/26/configuring-the-windows-time-service/

    As many of you that follow my blog know that I have blogged about the Time Service in the past. The original blog can be found here. However, the blog has so much information in it, you may have got lost trying to figure out exactly what to do. In this blog, I’ve condensed it and made it much easier to read by offering the steps as a pseudo flowchart. I hope you find it useful.

    Windows Server Time Sync Configuration

    The following steps can be used to configure DCs the default Windows time service hierarchy in an AD forest.  The procedure will also remove any errors in the Event Viewer, if any existed.

    Do not use if you are using a third party stratum service and refer to the vendor’s documentation for further instructions

    Check and Document the Current Time Configuration on the PDC Emulator

    1. First check and document the current configuration:
      1. All Windows Server domain operating systems – run the following on the forest root domain PDC Emulator.
        1. Note: In some cases you must wait a little time for the service to instantiate.
        2. If you do not see expected results immediately, wait 10 min and re-run the following steps
    2. W32tm /query /configuration   
      1. This command confirms the PDC Emulator shows the current source in the [TimeProviders] section, Look for “Type:” You will see one of the following:
        1. Type: NT5DS (Local)   -This means that it’s not synced externally.
        2. Type: NTP (Local)  –This command it is syncing externally.
                   NtpServer: time.windows.com [65.55.56.206] (Local)
      2. For all other DCs, use the command, w32tm /monitor (step 4 below)
    3. w32tm /query /source
      1. On the PDC Emulator, this shows the actual source. One of two possibilities:
        1. CMOS clock                    -Signifies not synced to an external source                                                  (Not what you want to see)
        2. time.windows.com  –The NTP source IPaddress/FQDN  This is correct.
    4. w32tm /monitor or w32tm /monitor /computers:DCNAME
      1. On the PDC Emulator, this command shows the outside time source.
        1. Good example:
          dc01.contoso.com *** PDC ***[10.10.10.200:123]:
          ICMP: 0ms delay
          NTP: +0.0000000s offset from dc02.contoso.com
          RefID: time.windows.com [65.55.56.206]
          Stratum: 4
      2. On all other DCs, this command shows the current time source DC for this DC.
        1. You will see an “offset for the PDC from its configured NTP source.
        2. Good example result showing the DC02 is syncing with dc01.contoso.com:
          dc02.contoso.com 10.10.10.210]:
          ICMP: 0ms delay
          NTP: +0.0000000s offset from dc01.contoso.com
          RefID: dc01.contoso.com [10.10.10.200]
          Stratum: 4
    5. w32tm /tz
      1. This shows the current time zone to make sure it’s correct.
    6. w32tm /stripchart /computer: target /samples: n /dataonly
      1. This command will show you the time difference between the local computer and a target computer and is helpful in determining if there is an offset. The “n” value is the number of time samples that will be returned from the target to test basic NTP communications.
    7. w32tm /dumpreg
      1. This command dumps the current registry settings found in:
        HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
        You can see the current time service configuration entries, such as:
        Type:  NTP

        NTPServer:

    *

    Configure time sync to a reliable source on the forest rood domain PDC Emulator ONLY.

    Do not perform on any other DC in any domain in the forest. PDC in the forest root only.

    1. Windows 2003 and all newer:
      1. Open an Administrator Command Prompt.
        1. Note that the examples below use either time.windows.com or the pool.ntp.org servers. You can get a full list of reliable time services at:
          A list of the Simple Network Time Protocol (SNTP) time servers that are available on the Internet: http://support.microsoft.com/kb/262680
      2. w32tm /config /manualpeerlist:time.windows.com /syncfromflags:manual /reliable:yes /update
        OR – if you want to use the pool.ntp.org time source servers:
      3. W32tm /config /manualpeerlist:0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org,0x1 /syncfromflags:manual /reliable:yes /update
      4. w32tm /resync /rediscover
      5. net stop w32time && net start w32time
      6. Check it with W32tm /query /configuration   
        1. You may have to repeatedly run it a few times until you see it change from the CMOS clock to the time server you set it to. If it doesn’t change after a few minutes, you may have to reset the time service in the Contingency section below.
    2. Windows 2000:
      Generally speaking, the w32tm command is similar to Windows 2003 and newer operating systems.  However, Windows 2000 uses the net time /setsntp method, which was removed in later versions.  There are also some differences between Windows 2000 RTM and various service packs. Therefore, if any issues arise from the commands not setting, it’s recommended to follow the instructions using the registry to configure the time service in Windows 2000:
      How to configure an authoritative time server in Windows 2000:
      http://support.microsoft.com/kb/216734
      1. Open an Administrator Command Prompt.
      2. net time /setsntp:174.140.19.7    – Windows 2000 uses this command to configure an outside source.
      3. net stop w32time
      4. w32tm -once      W32tm performs numerous commands. Their results are displayed on the screen.
      5. net start w32time
      6. Check it with W32tm /query /configuration   
        1. You may have to repeatedly run it a few times until you see it change from the CMOS clock to the time server you set it to. If it doesn’t change after a few minutes, you may have to reset the time service in the Contingency section below
    3. Use the procedure in Step #1 to check and document the new configuration.
    4. Contingency: Perform the steps in the Corrupted Time Service Resolution Section to return the settings back to Windows defaults.

    *

    Configure all other DCs to sync using the forest time hierarchy

    This includes all other DCs in the forest root domain that are not holding the PDC Emulator role, and any DC in any other domains and trees, including the PDC in those domains.

    Do NOT run the following on the PDC Emulator in the forest root domain.

    1. First check and document the current configuration: See Section #3 above.
    2. Windows Server 2003 and all newer server operating systems: 
      1. Open an Administrator Command Prompt
      2. w32tm /config /syncfromflags:domhier /update /reliable:no
      3. w32tm /resync /rediscover
      4. net stop w32time && net start w32time
      5. Check it with W32tm /query /configuration   
        1. You may have to repeatedly run it a few times until you see it change from the CMOS clock to the time server you set it to. If it doesn’t change after a few minutes, you may have to reset the time service in the Contingency section below
    3. Windows 2000:
      For reference with Windows 2000, see the following link for more info:
      How to configure an authoritative time server in Windows 2000
      http://support.microsoft.com/kb/216734
      1. Open an Administrator Command Prompt.
      2. w32tm –s
      3. Net stop w32time && net start w32time
      4. Check it with W32tm /query /configuration   
        1. You may have to repeatedly run it a few times until you see it change from the CMOS clock to the time server you set it to. If it doesn’t change after a few minutes, you may have to reset the time service in the Contingency section below
    4. Use the procedure in Step #1 to check and DOCUMENT the new configuration.
    5. Contingency: Perform the steps in the Corrupted Time Service Resolution Section to return the settings back to Windows defaults.

    *

    Time configuration on FSMO transferred or seized DCs

    1. On the new forest root domain PDC Emulator, run the following:
      1. Open an Administrator command prompt:
      2. W32tm /config /manualpeerlist:0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org /syncfromflags:manual /reliable:yes /update
        1. Note: time.windows.com is a working time source, however you choose any reliable time services in your locale.
      3. W32tm /resync /rediscover
      4. net stop w32time && net start w32time
      5. Check it with W32tm /query /configuration   
        1. You may have to repeatedly run it a few times until you see it change from the CMOS clock to the time server you set it to. If it doesn’t change after a few minutes, you may have to reset the time service in the Contingency section below
    2. On the server formerly holding the PDC Emulator role, run the following:
      1. Open an Administrator command prompt.
      2. w32tm /config /syncfromflags:domhier /update
      3. w32tm /resync /rediscover
      4. net stop w32time && net start w32time
      5. Check it with W32tm /query /configuration   
        1. You may have to repeatedly run it a few times until you see it change from the CMOS clock to the time server you set it to. If it doesn’t change after a few minutes, you may have to reset the time service in the Contingency section below
    3. Follow the procedure in Step #1 to check and DOCUMENT the new configuration.
    4. Contingency: Perform the steps in the Corrupted Time Service Resolution Section to return the settings back to Windows defaults.

    *

    Corrupted Time Service Resolution Section (Contingency)

    If any of the procedures did not work or event log errors indicate any issues, you can reset the time service registry entries back to default. The procedure should be done on the DC that you are experiencing issues with and not necessarily on each DC.  Note: This procedure can also be used as a contingency to return a DC (PDC and non-PDCs) back to local CMOS time sync.

    1. On the DC that you’re experiencing issues with, run the following:
      1. Open an Administrator command prompt.
      2. net stop w32time
      3. w32tm /unregister
      4. w32tm /register
      5. net start w32time
      6. Configure the DC according to the configuration sections above depending on if it’s a PDC Emulator or non-PDC Emulator.
    2. The next command is ONLY for Windows 2000 to 2008 DCs. It does not apply to 2008 R2 or newer and will be ignored if you try it.
      1. “net time /setsntp: ”      – Do not use the quotes. Note that there’s a blank space prior to the closing quote.
        This command tells the client (whether a DC or workstation) to delete the current registry settings for time and use default settings.
      2. net stop w32time && net start w32time
      3. Configure the DC according to the configuration sections above depending on if it’s a PDC Emulator or non-PDC Emulator.

    *

    W32Time Service Accuracy

    Please bear in mind that the Windows W32Time service is not a full featured, accurate service for time sensitive application requirements, nor will Microsoft support it as such. You must use a third party time service that will support this requirement.

    For more information, please visit the following link:

    Support boundary to configure the Windows Time service for high-accuracy environments
    http://support.microsoft.com/kb/939322

    ==================================================================

    References

    How the Windows Time Service Works
    http://technet.microsoft.com/en-us/library/71e76587-28f4-4272-a3d7-7f44ca50c018

    Windows Time Service Technical Reference
    http://technet.microsoft.com/en-us/library/a0fcd250-e5f7-41b3-b0e8-240f8236e210

    Windows Time Service Tools and Settings
    Includes specific w32tm command switches and registry entries.
    http://technet.microsoft.com/en-us/library/cc773263

    =================================================================

    Summary

    I hope this helped you to easily configure your time service and what to do if it didn’t work.

    Ace Fekay
    MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP – Directory Services

    clip_image002[6] clip_image004[6] clip_image006[6] clip_image008[6] clip_image010[6] clip_image012[6] clip_image014[6]

    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php

    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

    DNS Client side Resolver Service and DNS Forwarders Query Algorithm

    As many of you that follow my blogs, I had originally blogged about the client side resolver a few years ago. That can be found here:

    http://msmvps.com/blogs/acefekay/archive/2009/11/29/dns-wins-netbios-amp-the-client-side-resolver-browser-service-disabling-netbios-direct-hosted-smb-directsmb-if-one-dc-is-down-does-a-client-logon-to-another-dc-and-dns-forwarders-algorithm.aspx

    I think that many readers may have missed this portion because of the size of the blog, since after all it’s buried in one of the sections. Therefore, I thought to just specifically blog about it and get right to the point.

    Background:

    An internal DNS infrastructure is usually designed to support internal host name resolution fir internal hosts only. This is the goal whether it’s for any AD infrastructure or non-AD infrastructure, otherwise, why bother with DNS internally?

    This is of course, especially true with AD. AD uses DNS. DNS stores AD’s resource and service locations in the form of SRV records, hence how everything that is part of the domain will find resources in the domain.

    If the ISP’s DNS is configured in the any of the internal AD member machines’ IP properties, (including all client machines and DCs), the machines will be asking the ISP’s DNS ‘where is the domain controller for my domain?” whenever it needs to perform a function, such as for a logon request, DC to DC replication communications requests, querying and applying GPOs, and more. Unfortunately, the ISP’s DNS does not have that info and they reply with an, “I dunno know” response, and things just fail.

    Using an ISP’s DNS, or the router as a DNS address, is analogous to asking the first passerby on the street, “Hey, where’s that case of beer that was in my refrigerator last night?” He’ll either not have an answer, or he’ll tell you his friends took it, which is the wrong answer anyway.

    The Client Side Resolver Service algorithm on all Windows 2000 and newer machines:

    If you mix the internal DNS and an external DNS, such as the DC as the first DNS entry, and the ISP’s DNS, or even using your router’s IP address as the second entry, will do the same thing. This because of the way the client side resolver service works on all machines (DCs and clients). The following should help better understand the client side service algorithm when attempting to resolve DNS names.

    To summarize:

    If a DNS query has already occurred and the client had already received a response, then the response is cached in the local resolver cache for the TTL of the DNS host record.  You can run “ipconfig /displaydns” to show what’s in cache and the remaining TTL of the host record. YOu can repeatedly repeat the command to see the TTL count down to 0, at which point it will disappear from the cache.

    If there was no prior query and it’s not cached or the TTL has expired, and if there are multiple DNS entries on a machine’s NIC (whether a DC, member server or client), it will ask the first entry first.

    • If it receives a response, but say if the DNS server does not have the zone data (such as if you were to use your ISP’s DNS or your router as a DNS address, and expect that to work with AD), then it will be an NXDOMAIN or NACK response, meaning it got a response, even though it was wrong, and it will not go to the next DNS entry in the NIC’s list.
    • If it doesn’t respond, which is evident of a NULL response (no response, such as if the DNS server is down), it will go to the second entry after a time out period, which can last 15 seconds or more as it keeps trying the first one, at which then it REMOVES the first entry from the eligible resolvers list, and won’t go back to it for another 15 minutes (or forcing it by restarting the DNS Client service). This can also happen when a DC/DNS is down, or taken offline purposely for some reason, such as performing DC maintenance during production hours, it may cause issues within AD when accessing a resource such as a printer, folder, getting GPOs to function, etc. You can also reset the eligible resolvers list by:
    • If using Windows 2008/Vista and newer, restart the DNS Client Service
    • If using Windows 2000, 2003 or XP, restart the DHCP Client Service
    • Configure a registry entry to force the TTL to reset the list after each query.
    • Run an ipconfig /flushdns
    • Restart the machine.

    If the ISP’s is the first one in the list in the NIC’s properties, obviously it will be knocked out when a client is trying to login.

    This will be be noticed by a significantly long logon time period the client will experience before it goes to the second one, your internal DNS. So now the first one is knocked out for 15 minutes. Then say the client decides to go to an internet site. It will be querying the internal DNS at this point. As long as the internal DNS is configured with forwarders to an outside DNS, or use it’s Roots, it will resolve it.

    Specifics on the resolver process:

    Understanding the DNS Client Service and how Name Resolution works
    http://networkadminkb.com/KB/a118/understanding-dns-client-service-how-name-resolution-works.aspx

    Don’t Use your ISP’s DNS or your Router as a DNS Address on any Machine

    So why even bother with an ISP in the client? This is another good reason to ONLY use the internal DNS server in the VPN’s DHCP service for VPN clients. Keep in mind, the client will probably be configured with an ISP’s anyway if outside the network. Fine, otherwise it can’t find the VPN server on the internet anyway. But once the VPN authenticates and is connected, the VPN interface will be the first on the binding order, which now you WANT to only have the internal DNS servers in that interface.

    DNS Client side resolver service
    http://technet.microsoft.com/en-us/library/cc779517.aspx

    The DNS Client Service Does Not Revert to Using the First Server in the List in Windows XP (applies to Vista and newer, too)
    http://support.microsoft.com/kb/320760

    Therefore, the ISP’s DNS, some other external DNS server, or using the router as a DNS address, should not be used in any internal AD client or any other machine that is part of the AD infrastructure that must find a domain controller in order to function.

    Ipconfig examples:

    • BAD EXAMPLE

    In this BAD example, there are mixture of internal and external DNS servers. On top of that, there are just way too many DNS servers, which the client side resolver time out will never see beyond the third one, if lucky.

    C:\>ipconfig /all

    Windows IP Configuration

       Host Name . . . . . . . . . . . . : Computer1
       Primary Dns Suffix  . . . . . . . : contoso.com
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
       DNS Suffix Search List. . . . . . : contoso.com

    Ethernet adapter Local Area Connection:

       Connection-specific DNS Suffix  . : contoso.com
       Description . . . . . . . . . . . : Intel(R) Centrino(R) Advanced-N 6250 AGN
       Physical Address. . . . . . . . . : 64-80-98-11-5C-24
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::81ba:f421:cced:8826%11(Preferred)
       IPv4 Address. . . . . . . . . . . : 10.10.100.58(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Lease Obtained. . . . . . . . . . : Monday, March 24, 2014 10:07:18 AM
       Lease Expires . . . . . . . . . . : Saturday, April 05, 2014 10:45:58 PM
       Default Gateway . . . . . . . . . : 10.10.100.1
       DHCP Server . . . . . . . . . . . : 10.10.100.20
       DHCPv6 IAID . . . . . . . . . . . : 308576409
       DHCPv6 Client DUID. . . . . . . . : 00-01-00-E1-F4-6D-04-11-22-67-01-15-21
      DNS Servers . . . . . . . . . . . : 10.10.100.20
                                                   208.67.222.222
                                                  208.248.240.23
                                                 4.2.2.2
                                                 4.3.4.4

                                                 10.10.100.30
       NetBIOS over Tcpip. . . . . . . . : Enabled

    • GOOD EXAMPLE – You can see only the internal DNS servers are specified.

    C:\>ipconfig /all

    Windows IP Configuration

       Host Name . . . . . . . . . . . . : Computer1
       Primary Dns Suffix  . . . . . . . : contoso.com
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
       DNS Suffix Search List. . . . . . : contoso.com

    Ethernet adapter Local Area Connection:

       Connection-specific DNS Suffix  . : contoso.com
       Description . . . . . . . . . . . : Intel(R) Centrino(R) Advanced-N 6250 AGN
       Physical Address. . . . . . . . . : 64-80-98-11-5C-24
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::81ba:f421:cced:8826%11(Preferred)
       IPv4 Address. . . . . . . . . . . : 10.10.100.58(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Lease Obtained. . . . . . . . . . : Monday, March 24, 2014 10:07:18 AM
       Lease Expires . . . . . . . . . . : Saturday, April 05, 2014 10:45:58 PM
       Default Gateway . . . . . . . . . : 10.10.100.1
       DHCP Server . . . . . . . . . . . : 10.10.100.20
       DHCPv6 IAID . . . . . . . . . . . : 308576409
       DHCPv6 Client DUID. . . . . . . . : 00-01-00-E1-F4-6D-04-11-22-67-01-15-21
      DNS Servers . . . . . . . . . . . : 10.10.100.20
                                                   10.10.100.30

       NetBIOS over Tcpip. . . . . . . . : Enabled

    Configure a Forwarder Using your ISP’s DNS

    That’s your best bet. It’s easy.

    • Open the DNS console
    • Right-click the DNS server name
    • Choose Properties
    • Click the Forwarder tab.
    • Enter the ISP’s DNS address in the Forwarders list.

    And also, keep in mind, that if you have more than two or three Forwarders, the third one will probably never get checked because of the time-out of the client side resolver service *waiting* for a response to a query.

    Router’s IP as a DNS Service

    Don’t do it! Your router is NOT a DNS server. If you do, what the router will do is it will proxy the query request to its outside interface, which it will more than likely be using the ISP’s DNS. So that won’t work. Remove it from any machines as a DNS address.

    Summary

    I hope that helps understand why not to use an ISP’s DNS in your internal network.

    Ace Fekay
    MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP – Directory Services
    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php

    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

    FaceBookTwitterLinkedIn