This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Author: Ryan Watson | |
:: Twitter: @gentlemanwatson | |
:: Version: 1.0 | |
:: Credits: Credit to Syspanda.com and their Sysmon GPO article for the kick off point | |
:: https://www.syspanda.com/index.php/2017/02/28/deploying-sysmon-through-gpo/ | |
:: ** IMPORTANT ** | |
:: 1) Create a Sysmon folder with the SYSVOL share on your domain controller | |
:: 2) Download Sysmon from Microsoft and place both sysmon.exe and sysmon64.exe in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Servers = @("SERVER01","SERVER02","SERVER03") | |
$FolderPaths = $Servers | foreach { | |
Get-ChildItem "\\$_\DFSShare$" | |
} | Sort Path | |
$FolderPaths | Export-Csv "FolderPaths-$(Get-Date -format yyyy-MM-dd).csv" -NoTypeInformation | |
$TestPaths = (($FolderPaths).FullName | Sort-Object).Trimend('\') | |
$DFSPaths = ((Import-CSV "DFS-$(Get-Date -format yyyy-MM-dd).csv").TargetPath | Where-Object {($_ -ilike "*SERVER*") | Sort-Object).Trimend('\') |