O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Active Directory with PowerShell

Book Description

Learn to configure and manage Active Directory using PowerShell in an efficient and smart way

In Detail

Windows PowerShell is a task-based command-line shell and is gaining popularity day-by-day. Using PowerShell to manage the Active Directory environment not only saves time for the system administrator, but end users also benefit as they see their requests being fulfilled in very little time.

The book starts with an overview of the components, software, and modules required to manage Active Directory with PowerShell. It then moves on to help you create and manage users, computer accounts, and group policies with simple examples to automate daily tasks. Furthermore, it covers topics such as GPOs, DNS Server/Client, DFS-N, and DFS-R automation. It also demonstrates how to automate some advanced operations so that they can be scripted to perform in a faster and more efficient way. By the end of this book, you will be competent enough to use PowerShell to manage your Active Directory environment and will gain all the required knowledge to automate your daily operations.

What You Will Learn

  • Manage user and computer accounts using PowerShell
  • Automate group membership additions, removals, and bulk operations using PowerShell
  • Perform various query operations against Active Directory to fetch user, computer, and group details in an efficient and faster way
  • Understand how sites, subnets, and domains are managed
  • Perform advanced operations such as Domain Controller promotion/demotion
  • Discover how to automate replication checks, fine grained password policy creation, and FSMO roles transfer/seize using PowerShell
  • Get to know more about DNS server management, record creation/modification/ deletion, and DNS client management with PowerShell
  • Find out ways to automate DFS-N and DFS-R installation and configuration using PowerShell

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Active Directory with PowerShell
    1. Table of Contents
    2. Active Directory with PowerShell
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
        3. Instant updates on new Packt books
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Let's Get Started
      1. Ways to automate Active Directory operations
        1. The Microsoft Active Directory module
          1. Installing Active Directory
            1. Installing the Remote Server Administration Tool kit
            2. Installing the Active Directory module
          2. Testing the functionality
        2. Quest Active Directory PowerShell cmdlets
          1. Installing Quest
          2. Testing the functionality
        3. Using the Native method of PowerShell
      2. Summary
    9. 2. Managing User and Computer Objects
      1. Managing user accounts
        1. Creating user accounts
        2. Creating bulk user accounts
      2. Modifying user properties
        1. Updating the description of a user object
        2. Updating the telephone numbers of multiple users
        3. Enabling or disabling user accounts
        4. Moving user accounts to another OU
      3. Deleting user accounts
      4. Managing computer accounts
        1. Creating computer accounts
        2. Modifying computer accounts
          1. Setting the description for a computer account
          2. Moving computer accounts to a different OU
          3. Enabling or disabling computer accounts
      5. Deleting computer accounts
      6. Summary
    10. 3. Working with Active Directory Groups and Memberships
      1. Creating different types of security groups
      2. Searching and modifying group object information
      3. Adding members to a group
        1. Adding user accounts to groups
        2. Adding computer accounts to groups
        3. Adding one group as a member to an other
      4. Listing members of a security group in Active Directory
      5. Removing members from an AD group
      6. Deleting a security group
      7. Summary
    11. 4. Configuring Group Policies
      1. Installing the Group Policy module
      2. Querying Group Policies
      3. Creating and linking Group Policies
      4. Working with links, enforcements, and order of GPOs
      5. Working with Group Policy permissions
        1. Querying GPO permissions
        2. Modifying GPO permissions
      6. Updating Group Policy and generating Resultant Set of Policy
        1. Remotely triggering Group Policy update
        2. Collecting RSOP data remotely
      7. Removing Group Policy links and objects
      8. Summary
    12. 5. Managing Domains, Organizational Units, Sites, and Subnets
      1. Managing domains
        1. Querying forest and domain details
        2. Querying domain controller details
        3. Querying flexible single-master operation role owners
      2. Managing Organizational Units
        1. Searching for OUs
        2. Creating OUs
        3. Modifying OUs
        4. Renaming, moving, and deleting OUs
      3. Managing sites and subnets
        1. Querying sites and subnets
        2. Creating and modifying sites
        3. Creating and modifying subnets
        4. Removing sites and subnets
      4. Summary
    13. 6. Advanced AD Operations Using PowerShell
      1. Installing a new domain
      2. Adding additional domain controllers
      3. Obtaining an Active Directory replication status
      4. Managing Fine-Grained Password Policies
      5. Transferring FSMO roles
      6. Restoring deleted objects
      7. Demoting domain controllers and removing domains
      8. Summary
    14. 7. Managing DFS-N and DFS-R Using PowerShell
      1. Installing DFS roles
        1. Installing the DFS-N role
        2. Installing the DFS-R role
      2. Managing DFS-N
        1. Querying DFS namespaces
        2. Querying DFS-N folders and targets
        3. Creating the DFS-N root and folders
        4. Adding and removing folder targets
      3. Managing DFS-R
        1. Querying DFS-R groups and settings
        2. Creating a DFS-R group
        3. Deleting a DFS-R group
      4. Summary
    15. 8. Managing Active Directory DNS Using PowerShell
      1. Installing and configuring a DNS server
        1. Installing a DNS server
        2. Configuring the DNS server
          1. Changing the listening IP address
          2. Enabling or disabling recursion
      2. Working with root hints and forwarders
        1. Conditional forwarders
      3. Managing DNS zones
      4. Creating, modifying, and deleting DNS records
        1. Managing A records and PTR records
        2. Managing CNAME records
      5. Managing DNS Clients
      6. Summary
    16. 9. Miscellaneous Scripts and Resources for Further Learning
      1. Checking whether a user, group, computer, or an OU exists
        1. Usage
      2. Getting membership of a user, computer, and group
        1. Usage
      3. Resetting the password for multiple user accounts
        1. Usage
      4. Bulk creation of user accounts
        1. Usage
      5. Getting the password expiry date of user accounts
        1. Usage
      6. Finding all the disabled user accounts
        1. Output
      7. Getting all domain controllers and their site names in the forest
        1. Usage
      8. Moving objects from one OU to another
        1. Usage
      9. Finding inactive computers in Active Directory
        1. Usage
      10. Creating groups in bulk
        1. Usage
      11. Exporting an AD group member's details to CSV
        1. Usage
      12. Finding empty groups in Active Directory
        1. Usage
      13. Verifying whether a user is a member of the given group or not
        1. Usage
      14. Comparing AD groups' membership
        1. Usage
      15. Resources for further learning
        1. PowerShell resources
        2. Active Directory resources
    17. Index