Capture a Compliance script

If you want to capture exactly what a compliance (Desired configuration) setting is running, it only exists for a brief moment when the script is running.

This trick polls the folder and grabs the file when it appears.

It’s geared a PowerShell script but I expect you could change that to vbs. Or maybe just grab whatever comes around.

[PowerShell code]
$destination = "$env:userprofile\desktop\temp"
if (-not (test-path $destination)){mkdir $destination}
$i = 1
Do{
  copy C:\WINDOWS\CCM\SystemTemp\*.ps1 $destination
} while ($i -lt 100)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s