Scripting Question

How could I setup a Custom inventory for this registry key?

01/13/2014 4906 views

I'm wanting to find out how many machines have printers that are mapped from our old print server.

I've found this in the registry:



As you can see these are two seperate printers that are mapped to my computer from the server \\print

How could I use custom inventory to find computers that have printers mapped from the print server using information from these registry keys?

I don't think there is a "Registry key contains" inventory so how could I do this?

Answer Summary:
0 Comments   [ + ] Show comments


Community Chosen Answer


You might be able to use a custom inventory rule to get the data you are looking for.

RegistryValueReturn(registryPath, name, type)

I don't remember if you can read a user key or not.  I think not because the agent doesn't normally have access to the user account.  If that's the case, you could run a batch file to read the key and create a file.  Then use a custom inventory rule to get the info into the K1000.


Answered 01/13/2014 by: jknox
Red Belt

  • My brain too me down the Shellcommandtextreturn route to try pull all the keys in the connections folder then do an advanced search to pull all of them that have ,,print or something like that in them.
    Only problem is I'm not having much luck getting the shellcommand to work properly.

All Answers


Since printers are a per user thing you need to do a script to create a file then read that file as a custom inventory.

You can either export that part of the registry to file using a script or run a wmic command like:

wmic printer get name,servername > $(KACE_INSTALL)\printer.txt


Answered 01/14/2014 by: SMal.tmcc
Red Belt

  • Well my brilliant self discovered that I already had a list of printers in the custom inventory. Because there are so few that have the print server connected printer it didn't occur to me that I could just search through what I had already made.
    Thank you SMal for pointing out my stupidity gently. :)
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