Code Monkey home page Code Monkey logo

test-activedirectory's Introduction

Test-ActiveDirectory

Build status Test Coverage

This project contains a PowerShell module named ADAudit with cmdlets for retrieving and exporting detailed information about the configuration of an Active Directory forest. The module also contains a set of Pester tests that can be used to validate whether any configuration drift has occurred as well as perform a series of health tests of AD.

The validation of AD configuration drifts works by you initially using Get-ADConfig | Export-ADConfig -AsGoldConfig to generate a current "known-good state" snapshot of the configuration of AD. After this you can use Test-ActiveDirectory, or run the ActiveDirectory.tests.ps1 file directly to compare the known good state to the current AD state (or a previously retrieved snapshot of the state).

This code builds on the Active Directory Operational Test work of Irwin Strachan (@IrwinStrachan) which he has detailed here:

Installation

This module is published in the PowerShell Gallery, so can be installed via:

Install-Module ADAudit -Scope CurrentUser

Requirements

This module requires the following modules be installed/available:

  • ActiveDirectory
  • Pester

Cmdlets

Get-ADConfig

Execute to retrieve the current AD configuration as a PowerShell object.

Export-ADConfig

Use to export the current AD configuration to an XML file. If you're saving the current known-good state, use -AsGoldConfig to have the exported configuration prefixed with GoldConfig-.

Test-ActiveDirectory or ActiveDirectory.tests.ps1

Execute to perform the following tests:

Active Directory configuration checks

  • Various checks of the config between what has been stored previously and what has been captured now to detect configuration drift.

Active Directory health checks

  • Runs NLTest /Query and checks the output for "Success"
  • Runs DCDiag -a and checks the output for "failed"
  • Runs RepAdmin /showrepl and checks each replication for the "Number of Failures" count being > 0
  • Performs a Ping against each listed DC (per config)
  • Tests that common AD ports respond locally: (53,88,135,139,389,445,464,636,3268,3269,9389)
  • Checks that common AD services are running: ("ADWS","BITS","CertPropSvc","CryptSvc","Dfs","DFSR","DNS","Dnscache","eventlog","gpsvc","kdc","LanmanServer","LanmanWorkstation","Netlogon","NTDS","NtFrs","RpcEptMapper","RpcSs","SamSs","W32Time")
  • Checks the SRV DNS records for _ldap.tcp.domainname and _kerberos.tcp.domainname

test-activedirectory's People

Contributors

markwragg avatar irwins avatar mwragg avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.