For all DC's, gather path locations to Sysvol, NTDS.dit and AD logs

Welcome Forums General PowerShell Q&A For all DC's, gather path locations to Sysvol, NTDS.dit and AD logs

Viewing 1 reply thread
  • Author
    Posts
    • #176239
      Participant
      Topics: 120
      Replies: 258
      Points: 229
      Rank: Participant

      For a given domain, I have this code to gather up all of my DC's:

      Get-ADComputer -LDAPFilter "(&(objectCategory=computer)(userAccountControl:1.2.840.113556.1.4.803:=8192))" | ForEach-Object {
          "Processing $($_.DNSHostName) ..." }

      ..how can I use this array to output to csv the paths to:
      Sysvol
      ntds.dit
      AD logs

      Thank you

    • #176500
      Participant
      Topics: 6
      Replies: 108
      Points: 302
      Helping Hand
      Rank: Contributor

      Not sure what you're really looking for... The sysvol folder is in the same place on each domain controller as is the ntds.dit file. Take a look at the solution on this post: https://social.technet.microsoft.com/Forums/windows/en-US/739caf4a-2554-44ca-a480-6d0cfe44da18/where-does-ntdsdit-is-stored?forum=winservergen
      For the record, you can get the domain controllers a little easier:

      Get-ADDomainController -Server domain.local -Filter *
      • #185033
        Participant
        Topics: 120
        Replies: 258
        Points: 229
        Rank: Participant

        Charles, sorry for the late reply...Thank you for your response and the optimized one-liner.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.