Results from a batch file as Custom Inventory Field
I developed this script to extract an AD attribute for a computer:
-------------------------------------------------
@Echo Off
FOR /F "tokens=*" %%A IN ('dsquery computer -name %COMPUTERNAME%') DO (SET MyComputer=%%A)
FOR /F "tokens=*" %%A IN ('dsquery * %MyComputer% -attr XXXXXX') DO (SET MyAttribute=%%A)
Echo %MyAttribute%
-------------------------------------------------
The result is a single line of text and the data changes at regular intervals.
How do I get the output of this batch file to appear as a Custom Inventory Field or as something related to the Computer properties that the helpdesk team can view while in the K1000? The tech may be working off site so it may not be convenient to have to RDP over to a DC to get the value out of AD.
Answers (1)
Then create a CIR which runs the script with ShellCommandTextReturn like
ShellCommandTextReturn(cmd /c c:\programdata\quest\kace\ownscripts\script.bat)