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

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
1 week, 1 day ago.

  • Author
    Posts
  • #176239

    Participant
    Topics: 115
    Replies: 244
    Points: 142
    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: 78
    Points: 143
    Helping Hand
    Rank: Participant

    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 *

You must be logged in to reply to this topic.