I've put this together for you quickly, it's a quick and dirty vbscript that will check the value in the registry and then write the result to a CSV file. You can test it out and see if it does what you need.
Set wshShell = CreateObject( "WScript.Shell" )
str= readFromRegistry("HKEY_CURRENT_USER\Software\Policies\Microsoft\Communicator\ImAutoArchivingPolicy","error")
if (str="1") then
'Is enabled. - Handle this however you want, I've outputted to CSV text file.
WriteAudit wshShell.ExpandEnvironmentStrings("%COMPUTERNAME%"),wshShell.ExpandEnvironmentStrings("%USERNAME%"),"True"
elseif (str="0") then
'Is disabled.
WriteAudit wshShell.ExpandEnvironmentStrings("%COMPUTERNAME%"),wshShell.ExpandEnvironmentStrings("%USERNAME%"),"False"
else
'This means the key is missing altogether
WriteAudit wshShell.ExpandEnvironmentStrings("%COMPUTERNAME%"),wshShell.ExpandEnvironmentStrings("%USERNAME%"),"Error"
end if
function readFromRegistry (strRegistryKey, strDefault )
Dim WSHShell, value
On Error Resume Next
Set WSHShell = CreateObject("WScript.Shell")
value = WSHShell.RegRead( strRegistryKey )
if err.number <> 0 then
readFromRegistry= strDefault
else
readFromRegistry=value
end if
set WSHShell = nothing
end function
function WriteAudit (username, computername, result)
'This is the output file, set this to whereever (for example a hidden network share that has read/write for every user.)
strFile = "C:\Temp\MyFile.Txt"
Const ForAppending = 8
set objFSO = CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.OpenTextFile(strFile, ForAppending, True)
objFile.WriteLine(Now & "," & computername & "," & username & "," & result)
objFile.Close
end function
Here's an example of the output:
4/3/2014 1:14:52 PM,gthomas,SURFACE-5332553,True