Building an Active Directory Inventory – Part 1

There are few parts to building an automated Active Directory Inventory.  We need to be able to inventory the DCs and pull general OS information, pull the NTDS.Dit, and any FSMO roles that they hold.  The second part of this series will cover querying the domain to find what Microsoft OSs are being used in the environment.  Not all that important for most people, but something my management is always asking for. The third part will cover Forest/Domain information and pull the other parts together, into one report.

Again, I put all my functions into a separate file called StoredFunctions.ps1, this way I can call them from any file and reuse over and over again.

This first part will pull the following information from each DC in the domains:

  • Enabled
  • HostName
  • IP
  • DomainName
  • FQDN
  • OS
  • OSVersion
  • SPLevel
  • LastBoot
  • InfrastructureMaster (Does it hold the FSMO Role)
  • PDCEmulator (Does it hold the FSMO Role)
  • RIDMaster (Does it hold the FSMO Role)
  • DomainNamingMaster (Does it hold the FSMO Role)
  • SchemaMaster (Does it hold the FSMO Role)
  • GlobalCatalog
  • Site
  • NTDSLocation
  • NTDSSize
  • NetLogon
  • SYSVOL
  • OtherShares
  • DN

You will be able to call this separately or together with the master inventory function.

Leave a Reply

Your email address will not be published. Required fields are marked *