Wednesday 28 September 2016

Active Directory Domain and Trust


what is domain and trust bsically and how this works: The trust allow share security information and network resources between same or dfferent domains.It can be accesed by Active Directory Forest ad Trust FOlder under Admin Tools or run domain.msc in run command.Normally when a different Domain user want to access resources of differecnt domain, it would require another user name password, but after enabling trust it will work like SSO (Single sign on). we will be doing advacned Trust Policy very soon in next update.Its require for Trust there network connectivity should be enabled between 2 root domain.
Four types of Trust available in Windows Server
 External Trust: is used to create a on way or two way non-transitive trust with another domain which reside outside of forest.
Realm Trust: trust between any non-Windows Kerberos, This trust relationship allows cross-platform interoperability with security services that are based on other versions of the Kerberos V5 protocol.
Forest Trust: when creating trust between 2 forest root domain name.
Shortcut trust: when  direct trusts between two domains that implicitly trust each other. Such a trust is sometimes referred to as a shortcut trust, and it can improve the speed at which resources are accessed across many different.

With 2 types of Forest level Trust:
One Way Forest Trust:  When trust in allowed between 2 different root domain from one side only Means the information will flow to one side that is allowed.
Two Way Forest Trust: when trust is allowed between 2 root domain and both are allowed to share information between them. Both Root Domains can send and receive information.
Transitive and Non-transitive Trusts: When configuring trusts, you’ll need to consider two main characteristics: transitivity and direction. Easy and direct concept to understand transitive relationships is like If Domain A trusts Domain B and Domain B trusts Domain C, then Domain A implicitly trusts Domain C. Trusts can be configured as nontransitive so that this type of behavior does not occur. In one-way relationships, the trusting domain allows resources to be shared with the trusted domain. In two-way relationships, both domains trust each other equally. Special trusts include external trusts, realm trusts, cross-forest trusts, and shortcut trusts.
NTLM Protocol (Msv1_0.dll): The NTLM authentication protocol is dependent on the Net Logon service on domain controllers for client authentication and authorization information. This protocol authenticates clients that do not use Kerberos authentication. NTLM uses trusts to pass authentication requests between domains.
Kerberos Protocol (Kerberos.dll): The Kerberos V5 authentication protocol is dependent on the Net Logon service on domain controllers for client authentication and authorization information. The Kerberos protocol connects to an online Key Distribution Center (KDC) and the Active Directory account store for session tickets. The Kerberos protocol also uses trusts for cross-realm ticket-granting services (TGS) and to validate Privilege Attribute Certificates (PACs) across a secured channel. The Kerberos protocol performs
cross-realm authentication only with non-Windows-brand operating system Kerberos realms such as an MIT Kerberos realm and does not need to interact with the Net Logon service.
Net Logon (Netlogon.dll): The Net Logon service maintains a secured channel from a Windows-based computer to a domain controller. It is also used in the following trust related processes:
    Trust setup and management – Net Logon helps maintain trust passwords, gathers trust information and verifies trusts by interacting with the LSA process and the TDO. For Forest trusts, the trust information includes the Forest Trust Information (FTInfo) record, which includes the set of namespaces that a trusted forest claims to manage, annotated with a field that indicates whether each claim is actually trusted by the trusting forest.
    Authentication – Supplies user credentials over a secured channel to a domain controller and returns the domain SIDs and user rights for the user.
    Domain controller location – Helps with finding or locating domain controllers in a domain or across domains.
Pass-through validation – Credentials of users in other domains are processed by Net Logon. When a trusting domain needs to verify the identity of a user, it passes the user’s credentials through Net Logon to the trusted domain for verification.
Privilege Attribute Certificate (PAC) verification – When a server using the Kerberos protocol for authentication needs to verify the PAC in a service ticket, it sends the PAC across the secure channel to its domain controller for verification.
LSA (Lsasrv.dll):The Local Security Authority (LSA) is a protected subsystem that maintains information about all aspects of local security on a system (collectively known as localsecurity policy) and provides various services for translation between names and identifiers. The LSA security subsystem provides services in both kernel mode and user mode for validating access to objects, checking user privileges, and generating audit messages. LSA is responsible for checking the validity of all session tickets presented by services in trusted or un-trusted domains.

DNS Setting require to update:Before Proceeding with Trust Relation, its very mandatory to update the DNS with the external domain. Because In Forest all Domain will be having trust relation.here you can restrict here with DNS IP that allowed for only given IP. In the below image you can see i had enabled zone transfer enabled to any server. Before Trust its mandatory that this option should be enabled on the server which you want to trust.Here you can also restrict also to zone transfer with specific domain IP only. After enabling this option it took hardly 15 min to transfer the zone from all4techie.in to all4techi.in (Dont be confuse, In both domain only spelling is different).














In below image it can be seen that Forest is having by default 2 way trust with Child and Additional Domain Controller.


























From here will start creating New Trust with Different Root Domain name.













We are enabling trust from All4techi.in to All4techie.in.













Here the wizard start, You want to enable External or Forest Trust.













Selected Two Way trust. As i want information to be pass from source and destination. Here you can select and restrict with One way incoming or one way outgoing as per your requirement. This option help when merger happen with 2 different domain name( or organization). where they want the information to be secured and restrict. As well At the time of transfer this two way trust option work to migrate users and objects.














This option enable to flow information between domain as well as child and Additional Domain also.













Here after connecting to destination will ask to authorize to proceed further.













and this given authentication verified for Forest level authentication. Her you can customize when you select the option from above screen with one way or two way with not forest level trust. You can limit the trust with in domain also.













Here is summary what i have selected before for enabling trust.



























I continued with Yes, confirm the outgoing trust.













Yes, i confirm the incoming too.













Final option, as summary that trust enabled between two different root domain.

















Here its confirm, that forest level trust enabled.










To verify i tried to give access to all4techie.in user to all4techi.in  folder and yessss i got it. I can give access to different domain user. It will work as Single sign on for both domain users.
let us know if any query or issue in implementing this in your setup.
I just tried to create an image that explain for all type of trust. Brainstorm your thoughts and post if any query.
Dont let sleep your zeal to learn and earn.

Active Directoy Site and Service with Replication



Replication being a very important feature in Active Directory. Its replicate the data from once DC to another DC. This maintain up time of the remote site, if there is any network or server issue with from branch to branch. Once you done with primary and secondary DC implement you can see in the Sites and Services there will be a Default First Site, where both DC's added automatically. From site and services console you can create and manage branch of your organization and it help admin to troubleshoot as well keep inventory of the server that which DC belong to which location.
The Primary DC will automatically replicate the data to secondary with help for this terminology. This data gets replicated not in the same physical location as well on remote location too. This can be done and configured from site and services console.
Just to better understanding you can refer this image, which I had done in my lab.














First figure is done in Windows 2003 Root DC (which is primary domain controller) and Second is done in 2012 AD Server (which is child Domain Controller). After Doing Site and services I can see these all are updated and replicated to child as well with Additional Domain Controller.
Had created 2 other sites in my lab to explain more about replication. New site can be create from First Root DC by right click and create new, and here you can put name as per best practise. If you created IP and Subnet also so at second image it will ask you to map the site with specific Subnet and IP. I didnt created any so by default it will map with DefaultIP SiteLink.


 





















In the above image you can see in the ROOTDC 2 connections are automatically added with other 2 DC for replication. It can be done manually but after just finishing AD Site and Services will automatically add replication connection on based of Bandwidth speed and site link objects and the main term is responsible is KCC. By default, the KCC reviews and makes modifications to the Active Directory replication topology every 15 minutes to ensure updating  of data, either directly or transitively, by creating and deleting connection objects as needed. The KCC recognizes changes that occur in the environment and ensures that domain controllers are not orphaned in the replication topology.
By default, KCC checks the topology every 15 minutes. This time cane be modified by changing the Repl topology update period (secs) entry in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters as follows:
Value: Number of seconds between KCC topology updates
Default: 900 seconds (15 minutes)
Data type: REG_DWORD

Tools to use check replication:
In 2003, to check replication status and troubleshooting you need to install Support tools from ISO under support folder. All tools be installed in program files under support tools folder and here you can get repadmin, replmon which gives you better understanding of replication.
In 2012 to check replication status you have to give this command
repadmin /showrepl <servername> /u:<domainname>\<username> /pw:*
and there is command which helps to understand very deeply of the replication topology of the Forest
repadmin /showrepl * /csv >showrepl.csv

In 2008 there is tool AD replication Monitor , from here you can check and schedule the replication check for the forest and that gives you awesome data with the exact details and error code, that help admins to troubleshoot also. 
This command will give you out in csv format with the below details, now assume what is the data. I can get all the details of Domain Hostname, Site name, replication status, failure reason, and in concern of architect it’s very useful to understand and design the AD network.
There is another tool From MS that is Active Directory Topology Diagram which gives you clear picture of your current environment. Once you will run this tool on your environment, it will take more than 30 min (depend on your environment) and that you can save in XPS or PDF or image.


Here is some common event ID, which generated during replication issue:
Event ID 1388: Inbound replication of the lingering objects
Event ID 1988: Inbound replication of the directory partition of the lingering object has been blocked on the destination domain controller.
Event ID 8606: "Insufficient attributes were given to create an objects
Event Id 8456 or 8457: "The source | destination server is currently rejecting replication requests
Error ID 8453 : Replication access was denied
Event ID 1722: The RPC server is unavailable
Event IDs 1388 and 2042: Replication Lingering Object Problems
Event IDs 1925, 2087, 2088 :Replication DNS Lookup Problems
Event ID 1925 : Replication Connectivity Problems 
  
Lots of there in AD, will be updating as and when I receive. I am sure once you start digging in to AD replication you will find lots of things and its very interesting but some time its bored me due to headache J. That time I just leave and leave.
Here another Option is IP and Subnet, which is like to move a DC with in there IP/Postal Code or region area. Its not restricted to Networking. Its created only to understand and manage that which DC belong to site/Network/Subnet.

Ports Require for AD Replication are
Service Name     UDP    TCP
LDAP                     389      389
LDAP                                  636
LDAP                              3268
Kerboros               88    88
DNS                       53    53
smb over IP      445   445



















From here you can see or change that which server is working as Global Catalogue 


















Here it shows the connection that from and to replication happening.

















Here it shows the objects updated number. USN refer the what was the starting objects and what is the latest.












And Above both image with Single site and multi Replication site will gives you lots of question for AD Scenario. Start brainstorming and raise questions that what how and if…..Let me know if any question there. we are there to assist you. I will be updating the next document as what if there is difference in policy and objects between all domain controller. It’s very Interesting activity. I love this.


Don’t let sleep your zeal to learn and earn.