Kace agent not retrieving registry values
I have a PS script that retrieves the bit value of Office 365 and outputs to a txt file. Works great when run from PowerShell on a local computer. See the script below.
Get-ItemPropertyValue -Path HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration -Name "Platform" | Out-File C:\Temp\offver.txt |
When I create a Kace script to run the PS script, it outputs the txt file to the defined location, but the txt file is blank.
I tried creating a .bat file, which works great on a local machine, but when run from Kace, it again outputs a blank txt file. See the bat file script below.
reg query HKLM\SOFTWARE\Microsoft\Office\ClickToRun\Configuration\ > c:\temp\offver.txt |
So, the script runs successfully, and it recognizes the command to output the results to a file, but there seems to be an issue accessing the registry? Or the correct registry location?
I've browsed through the forums and posts and tried a few things such as adding "HKLM64" to the beginning of the query, but still, Kace just outputs a blank txt file.
I have also adjusted the 'run-as' between local system and admin accounts, but still, just a blank txt file.
I have other PS scripts that output PowerShell results to a txt files, such as what monitors are connected, however the query doesn't access the registry, so I'm guessing its an issue with how the agent is accessing the registry.
Here is a screenshot of the Kace script
Answers (1)
Top Answer
Just a thought, wouldn't this be much better run as a custom inventory field, displaying the results in the inventory data for each Device?
Comments:
-
Yeah that works way better. Thank you very much! - Babaganoosh 2 years ago