Purpose: This script will search AD for Window computers and attempted to connect to each one. Then it will read the contents of the host file and write them to a csv file. Note: This will take a while to run unless someone wants to make it multithreaded. I just wrote this so there may need to be some bug fixes but in general it seemed to work. #Read all host files and write to CSV file Import-Module ActiveDirectory $PATH = "c:\temp\hostfiles.csv" $myCol = @() $AllComputers = Get-ADComputer -Filter {OperatingSystem -Like "Windows*"} -Property * | Select -Expand Name foreach ($Computer in $AllComputers){ $i++ Write-Progress -activity "Scanning Machine $Computer " -status "Scanned: $i of $($AllComputers.Count)" -percentComplete (($i / $AllComputers.Count) * 100) Get-Content -Path "\\$Computer\c$\windows\system32\drivers\etc\hosts" | where {!$_.StartsWith("#")} | for
These are just random notes and programs that may have incomplete descriptions. Any scripts or programs use at your risk