/build/static/layout/Breadcrumb_cap_w.png

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




0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Posted by: Hobbsy 1 year ago
Red Belt
0

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 1 year ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ