Active Directory Administration Cookbook - Second Edition

Book description

Simplified actionable recipes for managing Active Directory and Azure AD, as well as Azure AD Connect, for administration on-premise and in the cloud with Windows Server 2022

Key Features

  • Expert solutions for name resolution, federation, certificates, and security with Active Directory
  • Explore Microsoft Azure AD and Azure AD Connect for effective administration on the cloud
  • Automate security tasks using Active Directory tools and PowerShell

Book Description

Updated to the Windows Server 2022, this second edition covers effective recipes for Active Directory administration that will help you leverage AD's capabilities for automating network, security, and access management tasks in the Windows infrastructure.

Starting with a detailed focus on forests, domains, trusts, schemas, and partitions, this book will help you manage domain controllers, organizational units, and default containers. You'll then explore Active Directory sites management as well as identify and solve replication problems. As you progress, you'll work through recipes that show you how to manage your AD domains as well as user and group objects and computer accounts, expiring group memberships, and Group Managed Service Accounts (gMSAs) with PowerShell. Once you've covered DNS and certificates, you'll work with Group Policy and then focus on federation and security before advancing to Azure Active Directory and how to integrate on-premise Active Directory with Azure AD. Finally, you'll discover how Microsoft Azure AD Connect synchronization works and how to harden Azure AD.

By the end of this AD book, you'll be able to make the most of Active Directory and Azure AD Connect.

What you will learn

  • Manage the Recycle Bin, gMSAs, and fine-grained password policies
  • Work with Active Directory from both the graphical user interface (GUI) and command line
  • Use Windows PowerShell to automate tasks
  • Create and remove forests, domains, domain controllers, and trusts
  • Create groups, modify group scope and type, and manage memberships
  • Delegate, view, and modify permissions
  • Set up, manage, and optionally decommission certificate authorities
  • Optimize Active Directory and Azure AD for security

Who this book is for

This book is for administrators of existing Active Directory Domain Service environments as well as for Azure AD tenants looking for guidance to optimize their day-to-day tasks. Basic networking and Windows Server Operating System knowledge will be useful for getting the most out of this book.

Table of contents

  1. Active Directory Administration Cookbook Second Edition
  2. Contributors
  3. About the author
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Code in Action
    6. Download the color images
    7. Conventions used
    8. Get in touch
    9. Share Your Thoughts
  6. Chapter 1: Optimizing Forests, Domains, and Trusts
    1. Choosing between a new domain or forest
      1. Why would you have a new domain?
      2. What are the downsides of a new domain?
      3. Why would you create a new forest?
      4. What are the downsides of a new forest?
    2. Listing the domains in your forest
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Using adprep.exe to prepare for new Active Directory functionality
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Raising the domain functional level to Windows Server 2016
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Raising the forest functional level to Windows Server 2016
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Creating the right trust
      1. Trust direction
      2. Trust transitivity
      3. One-way or two-way trust
      4. Getting ready
      5. How to do it...
      6. See also
    7. Removing a trust
      1. Getting ready
      2. How to do it...
      3. How it works...
    8. Verifying and resetting a trust
      1. Getting ready
      2. How to do it...
      3. How it works...
    9. Securing a trust
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    10. Extending the schema
      1. Getting ready
      2. How to do it...
      3. There's more...
    11. Enabling the Active Directory Recycle Bin
      1. Getting ready
      2. How to do it...
      3. How it works...
    12. Managing UPN suffixes
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  7. Chapter 2: Managing Domain Controllers
    1. Preparing a Windows server to become a domain controller
      1. Intending to do the right thing
      2. Dimensioning the servers properly
      3. Preparing the Windows Server installations
      4. Preconfiguring the Windows servers
      5. Documenting the passwords
      6. See also
    2. Promoting a server to a domain controller
      1. Getting ready
      2. How to do it...
      3. See also
    3. Promoting a server to a read-only domain controller
      1. Getting ready
      2. How to do it...
      3. Checking proper promotion
      4. How it works...
      5. See also
    4. Using Install From Media
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Using domain controller cloning
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    6. Determining whether a virtual domain controller has a VM-GenerationID
      1. How to do it...
      2. How it works...
    7. Demoting a domain controller
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    8. Demoting a domain controller forcefully
      1. Getting ready
      2. How to do it...
      3. See also
    9. Inventory domain controllers
      1. How to do it...
    10. Decommissioning a compromised read-only domain controller
      1. How to do it...
      2. How it works...
  8. Chapter 3: Managing Active Directory Roles and Features
    1. About FSMO roles
      1. Recommended practices for FSMO roles
    2. Querying FSMO role placement
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Transferring FSMO roles
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. Seizing FSMO roles
      5. Getting ready
      6. How to do it...
      7. How it works...
    4. Configuring the PDC Emulator to synchronize time with a reliable source
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Managing time synchronization for virtual domain controllers
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Managing global catalogs
      1. Getting ready
      2. How to do it...
      3. How it works
  9. Chapter 4: Managing Containers and Organizational Units
    1. Differences between OUs and containers
      1. Containers
      2. OUs
      3. OUs versus Active Directory domains
    2. Creating an OU
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Deleting an OU
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Modifying an OU
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Delegating control of an OU
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    6. Modifying the default location for new user and computer objects
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
  10. Chapter 5: Managing Active Directory Sites and Troubleshooting Replication
    1. What do Active Directory sites do?
    2. Recommendations
    3. Creating a site
      1. Getting ready
      2. How to do it...
      3. See also
    4. Managing a site
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    5. Managing subnets
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    6. Creating a site link
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    7. Managing a site link
      1. Getting ready
      2. How to do it...
      3. See also
    8. Modifying replication settings for an Active Directory site link
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    9. Creating a site link bridge
      1. Getting ready
      2. How to do it...
      3. See also
    10. Managing bridgehead servers
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    11. Managing the ISTG and KCC
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    12. Managing UGMC
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    13. Working with repadmin.exe
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    14. Forcing replication
      1. Getting ready
      2. How to do it...
      3. How it works…
      4. See also
    15. Managing inbound and outbound replication
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    16. Modifying the tombstone lifetime period
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    17. Managing strict replication consistency
      1. Getting ready
      2. How to do it...
      3. How it works...
    18. Upgrading SYSVOL replication from FRS to DFSR
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    19. Checking for and remediating lingering objects
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
  11. Chapter 6: Managing Active Directory Users
    1. Creating a user
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    2. Deleting a user
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Modifying several users at once
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Moving a user
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Renaming a user
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Enabling and disabling a user
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Finding locked-out users
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    8. Unlocking a user
      1. Getting ready
      2. How to do it...
    9. Managing userAccountControl
      1. Getting ready
      2. How to do it...
      3. How it works...
    10. Using account expiration
      1. Getting ready
      2. How to do it...
      3. How it works...
  12. Chapter 7: Managing Active Directory Groups
    1. Creating a group
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Deleting a group
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Managing the direct members of a group
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Managing expiring group memberships
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Changing the scope or type of a group
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also…
    6. Viewing nested group memberships
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Finding empty groups
      1. Getting ready
      2. How to do it...
      3. How it works...
  13. Chapter 8: Managing Active Directory Computers
    1. Creating a computer
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    2. Deleting a computer
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Joining a computer to the domain
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    4. Renaming a computer
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Testing the secure channel for a computer
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    6. Resetting a computer's secure channel
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. Getting ready
      5. How to do it...
      6. How it works...
  14. Chapter 9: Managing DNS
    1. Managing the DNS server role on domain controllers
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    2. Creating a DNS zone
      1. Getting ready
      2. How to do it…
      3. How it works…
    3. Managing the DNS zone properties
      1. Getting ready
      2. How to do it…
      3. How it works…
    4. Deleting a DNS zone
      1. Getting ready
      2. How to do it…
      3. How it works…
    5. Creating a DNS record
      1. Getting ready
      2. How to do it…
      3. How it works…
    6. Deleting a DNS record
      1. Getting ready
      2. How to do it…
      3. How it works…
    7. Verifying the domain controller SRV DNS records
      1. Getting ready
      2. How to do it…
      3. How it works…
    8. Creating a DNS conditional forwarder
      1. Getting ready
      2. How to do it...
      3. How it works…
      4. See also
  15. Chapter 10: Getting the Most Out of Group Policy
    1. Creating a GPO
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    2. Copying a GPO
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Deleting a GPO
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    4. Modifying the settings of a GPO
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Assigning scripts
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Installing applications
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Linking a GPO to an OU
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    8. Blocking inheritance of GPOs on an OU
      1. Getting ready
      2. How to do it...
      3. How it works...
    9. Enforcing the settings of a GPO Link
      1. Getting ready
      2. How to do it...
      3. How it works...
    10. Applying security filters
      1. Getting ready
      2. How to do it...
      3. How it works...
    11. Creating and applying WMI filters
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    12. Refreshing GPO settings
      1. Getting ready
      2. How to do it…
      3. How it works…
    13. Configuring loopback processing
      1. Getting ready
      2. How to do it...
      3. How it works...
    14. Restoring a default GPO
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    15. Creating the Group Policy Central Store
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  16. Chapter 11: Securing Active Directory
    1. Applying fine-grained password and account lockout policies
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    2. Backing up and restoring GPOs
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Backing up and restoring Active Directory
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also…
    4. Working with Active Directory snapshots
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Managing the DSRM passwords on domain controllers
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Protecting important objects from accidental deletion
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    7. Implementing LAPS
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    8. Managing deleted objects
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    9. Working with gMSAs
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    10. Configuring diagnostic logging
      1. Getting ready
      2. How to do it…
      3. How it works…
    11. Configuring the advanced security audit policy
      1. Getting ready
      2. How to do it...
      3. How it works...
    12. Resetting the KRBTGT secret
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    13. Using the SCW to secure domain controllers
      1. Getting ready
      2. How to do it
      3. How it works...
    14. Leveraging the Protected Users group
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    15. Putting authentication policies and authentication policy silos to good use
      1. Getting ready
      2. How to do it...
      3. How it works...
    16. Configuring Extranet Smart Lockout
      1. Getting ready
      2. How to do it...
      3. How it works...
  17. Chapter 12: Managing Certificates
    1. Deciding between your own CA and a public CA
      1. How to do it…
      2. How it works…
      3. See also
      4. There's more…
    2. Setting up a CA
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    3. Setting up an online responder
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    4. Removing a certificate template
      1. Getting ready
      2. How to do it…
      3. How it works…
    5. Duplicating and editing a certificate template
      1. Getting ready
      2. How to do it…
      3. How it works…
    6. Requesting a web server certificate
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    7. Issuing domain controller certificates
      1. Getting ready
      2. How to do it…
      3. How it works…
    8. Managing certificate autoenrollment
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    9. Revoking a certificate
      1. Getting ready
      2. How to do it…
      3. How it works…
    10. Decommissioning a CA
      1. Getting ready
      2. How to do it…
      3. How it works…
  18. Chapter 13: Managing Federation
    1. Choosing the right AD FS farm deployment method
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    2. Installing the AD FS server role
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Setting up an AD FS farm with WID
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    4. Setting up an AD FS farm with SQL Server
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Adding additional AD FS servers to an AD FS farm
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Removing AD FS servers from an AD FS farm
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Creating an RPT
      1. Getting ready
      2. How to do it...
      3. How it works...
    8. Deleting an RPT
      1. Getting ready
      2. How to do it...
      3. How it works...
    9. Configuring branding
      1. Getting ready
      2. How to do it...
      3. How it works...
    10. Migrating a WID-based AD FS farm to an SQL Server
      1. Getting ready
      2. How to do it...
      3. How it works…
    11. Setting up a WAP
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    12. Decommissioning a WAP
      1. Getting ready
      2. How to do it...
      3. How it works...
  19. Chapter 14: Handling Authentication in a Hybrid World (AD FS, PHS, PTA, and DSSO)
    1. Choosing the right authentication method
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    2. Signing up for Azure AD
      1. Getting ready
      2. How to do it
      3. How it works…
    3. Verifying your DNS domain name
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Implementing PHS with Express Settings
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Implementing PTA and Seamless SSO
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    6. Implementing SSO using AD FS
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Managing AD FS with Azure AD Connect
      1. Getting ready
      2. How to do it...
      3. How it works...
    8. Implementing Azure Traffic Manager for AD FS geo-redundancy
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    9. Migrating from AD FS to PTA for SSO to Office 365
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    10. Making PTA (geo)redundant
      1. Getting ready
      2. How to do it...
      3. How it works...
  20. Chapter 15: Handling Synchronization in a Hybrid World (Azure AD Connect)
    1. Choosing the right source anchor attribute for user objects
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    2. Configuring staging mode
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Switching to a staging-mode server
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Configuring domain and OU filtering
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Configuring Azure AD app and attribute filtering
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Configuring hybrid Azure AD join
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Configuring device writeback
      1. Getting ready
      2. How to do it...
      3. How it works...
    8. Configuring password writeback
      1. Getting ready
      2. How to do it...
      3. How it works...
    9. Configuring group writeback
      1. Getting ready
      2. How to do it...
      3. How it works...
    10. Changing passwords for Azure AD Connect service accounts
      1. Getting ready
      2. How to do it...
      3. How it works...
  21. Chapter 16: Hardening Azure AD
    1. Setting contact information
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    2. Preventing non-privileged users from accessing the Azure portal
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Viewing all privileged users in Azure AD
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Preventing users from registering or consenting to apps
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Preventing users from inviting guests
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Allowing and blocking invitations for Azure AD B2B
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Configuring Azure AD join and Azure AD registration
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    8. Configuring Intune auto-enrollment upon Azure AD join
      1. Getting ready
      2. How to do it...
      3. How it works...
    9. Choosing between Security defaults and Conditional Access
      1. Getting ready
      2. How to do it...
      3. How it works…
    10. Configuring Conditional Access
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    11. Accessing Azure AD Connect Health
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    12. Configuring Azure AD Connect Health for AD FS
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more…
    13. Configuring Azure AD Connect Health for AD DS
      1. Getting ready
      2. How to do it...
      3. How it works...
    14. Configuring Azure AD PIM
      1. Getting ready
      2. How to do it...
      3. How it works...
    15. Configuring Azure AD Identity Protection
      1. Getting ready
      2. How to do it...
      3. How it works...
    16. Implementing Defender for Identity
      1. Getting ready
      2. How to do it…
      3. How it works…
    17. Why subscribe?
  22. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts

Product information

  • Title: Active Directory Administration Cookbook - Second Edition
  • Author(s): Sander Berkouwer
  • Release date: July 2022
  • Publisher(s): Packt Publishing
  • ISBN: 9781803242507