/bundles/itninjaweb/img/Breadcrumb_cap_w.png

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   [ - ] Hide Comments

Comments

Please log in to comment

Answer this question or Comment on this question for clarity

Answers

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.
Answered 01/28/2018 by: Nico_K
Red Belt

Please log in to comment

Share