/build/static/layout/Breadcrumb_cap_w.png

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.


0 Comments   [ + ] Show comments

Answers (1)

Posted by: Nico_K 6 years ago
Red Belt
1
Copy the script to a useable location (using file synchronization for instance)
Then create a CIR which runs the script with ShellCommandTextReturn like
ShellCommandTextReturn(cmd /c c:\programdata\quest\kace\ownscripts\script.bat)

The rest is automated. As soon as the script is on the location you want to have it the CIR will populate with the next check in.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
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