Powershell Command | Out-File
Problem: Determine remote computers Data Execution Prevention (DEP) status and pipe the results to a txt file including the machine name.
Current Solution: BCDEdit /enum "{current}" | out-file \FILESHARE\DEP\DEP.txt -Append
I'm pushing the script out through SCCM so my only issue is getting the machine name included with the results. SCCM allows you to run the script on each machine remotely as System so I don't have to worry about "get-content" with a list of PC's just point to a collection and run the script on those systems.
Alternatively, I tried to run Powershell command outside of SCCM such as:
$XenServers = get-content -path 'C:\PC_List.txt'
$Results= ForEach ($XenServer in $XenServers) { BCDEdit /enum "{current}" }
$Results | Out-File \FILESHARE\DEP\DEP.txt