Looking For Specific Network Printers by IP

(imported topic written by SystemAdmin)

I’ve tried several times to figure out what I’m doing wrong. I’ve attempted to rewrite

value “001e6700” of keys whose (value “00033009” of it as string =“02100000” ) of key (value “DefaultProfile” of it as string) of key “HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles” of registry

http://forum.bigfix.com/viewtopic.php?id=378.

To get what I’m looking for. This is what I’m looking for.

I need to look in

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\

for all printers using a specific IP address. This is what I’ve come up with but I think I’m far from being correct in my relevance.

Q: exists value “Port” of it as string =“192.1.1.1” of key (value “Port” of it as string) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Lexmark T520 (MS)\DsSpooler” of registry

E: “It” used outside of “whose” clause.

Thank you in advance

(imported comment written by pmullins91)

Something like this?

q: if (exists keys whose (exists value "Port" of it AND value "Port" of it as string = "Microsoft Document Imaging Writer Port:") of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\" of registry) then (names of keys whose (exists value "Port" of it AND value "Port" of it as string = "Microsoft Document Imaging Writer Port:") of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\" of registry) else ("Printer not found.")
A: Microsoft Office Document Image Writer
T: 0.492 ms
I: plural string

(imported comment written by SystemAdmin)

This will work… Thank you so much Pmullins this put me alot further then were I was initially.

I’ve changed your relevence to

if (exists keys whose (exists value “Port” of it AND value “Port” of it as string = “IP_192.1.1.1”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers” of registry) then (names of keys whose (exists value “Port” of it AND value “Port” of it as string = “IP_192.1.1.1”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers” of registry) else (“Printer not found.”)

Which returns the name of the printer I’m looking for, which helps immensely.

Is there a way to just get a true/false response if the IP 192.1.1.1 is one of the values so that I can use it in my relevance?

(imported comment written by pmullins91)

Sure thing. If your only concern is whether at least one printer with any name, exists with that port number then I would imagine the “if” part of your relevence above will do what you require.

exists keys whose (exists value "Port" of it AND value "Port" of it as string = "IP_192.1.1.1") of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\" of registry

Of course I still might not understand what you’re looking for - it’s less than an hour until my weekend begins. :wink:

(imported comment written by SystemAdmin)

You’re awesome… That worked. Thank you so much

(imported comment written by pmullins91)

Any time.