Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $logfile = "\\DS1\hiddenshare$\$env:computername $(get-date -f yyyy-MM-dd) log.txt"
- Write-Output "BEGIN - Logs of the PS script executed on $env:computername by $end:UserName" >> $logfile
- "[{0:MM/dd/yy} {0:HH:mm:ss}]" -f (Get-Date) >> $logfile
- Get-WindowsCapability -name Rsat.ActiveDirectory.DS-LDS.Tools* -online 2>&1 >> $logfile
- Get-WindowsCapability -name Rsat.ActiveDirectory.DS-LDS.Tools* -online |Add-WindowsCapability -online 2>&1>> $logfile
- Get-WindowsCapability -name Rsat.ActiveDirectory.DS-LDS.Tools* -online 2>&1 >> $logfile
- "[{0:MM/dd/yy} {0:HH:mm:ss}]" -f (Get-Date) >> $logfile
- Write-Output "END - Logs of the PS script executed on $env:computername by $end:UserName" >> $logfile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement