0

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
1
  • Don't forget to ask your question. – Bill_Stewart Oct 18 '19 at 17:41
1

I'd recommend using an entirely PowerShell solution. According to the link below, the Win32_OperationSystem class contains the value you are looking for in the DataExecutionPrevention_SupportPolicy property. The objects returned from WMI queries also include the PSComputerName property so it's an easy way to keep track of the results. I'm not a fan of this kind of formatting so I am including another recommendation.

get-WmiObject Win32_OperatingSystem |
  Select-Object PSComputerName, DataExecutionPrevention_SupportPolicy |
  Export-Csv -Path \\FILESHARE\DEP\DEP.csv -Append -NoTypeInformation

https://support.microsoft.com/en-us/help/912923/how-to-determine-that-hardware-dep-is-available-and-configured-on-your

2
  • 1
    Thank you so much for the reply! So after some time, I finally got your code to work. Apparently after the file was initially created on the file share, it would allow one entry from the first machine and nothing else would append. It wasn't until I changed the inhereted permissions for "Users" to be able to also modify, that all the other machines begain to populate. I also added -force before changing the "Users" permission to try and resolve the issue. – Shawn Oct 30 '19 at 17:01
  • get-WmiObject Win32_OperatingSystem | Select-Object PSComputerName, DataExecutionPrevention_SupportPolicy | Export-Csv -Path \\FILESHARE\Deployments\Temp\DEP\DEP_Status.csv -append -notypeinformation | start-sleep -s 5 – Shawn Nov 1 '19 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.