/build/static/layout/Breadcrumb_cap_w.png

Searching For specific software within a Label

I am currently using the following script to find a list of machines with a certain

update installed on them.

 

select MACHINE.NAME as Computer_Name, SYSTEM_DESCRIPTION, IP, MAC, REPLACE(MACHINE.USER_LOGGED,'\\','\\\\') as USER_LOGGED, CS_DOMAIN from (SOFTWARE, MACHINE_SOFTWARE_JT, MACHINE) where MACHINE.ID = MACHINE_SOFTWARE_JT.MACHINE_ID and MACHINE_SOFTWARE_JT.SOFTWARE_ID = SOFTWARE.ID and SOFTWARE.DISPLAY_NAME like '%KB2661254%' order by DISPLAY_NAME

 

this works but I need to add a filter in so it just brings back results for the label EMEA.

Any suggestions?

 

Thanks,

Gary


0 Comments   [ + ] Show comments

Answers (2)

Posted by: jverbosk 12 years ago
Red Belt
1

OK, it appears that Smart labels don't like table aliases - try this version, working here.

John

________________

SELECT MACHINE.NAME as Computer_Name, SYSTEM_DESCRIPTION, IP, MAC,
REPLACE(MACHINE.USER_LOGGED,'\\','\\\\') as USER_LOGGED, CS_DOMAIN
FROM MACHINE
JOIN MACHINE_SOFTWARE_JT ON (MACHINE_SOFTWARE_JT.MACHINE_ID = MACHINE.ID)
JOIN SOFTWARE ON (SOFTWARE.ID = MACHINE_SOFTWARE_JT.SOFTWARE_ID)
JOIN MACHINE_LABEL_JT ON (MACHINE_LABEL_JT.MACHINE_ID = MACHINE.ID)
JOIN LABEL ON (LABEL.ID = MACHINE_LABEL_JT.LABEL_ID)
WHERE DISPLAY_NAME like '%KB2661254%'
AND LABEL.NAME = 'EMEA'
ORDER BY DISPLAY_NAME

Posted by: jverbosk 12 years ago
Red Belt
0

Try this.

John

______________

SELECT M.NAME as Computer_Name, SYSTEM_DESCRIPTION, IP, MAC,
REPLACE(M.USER_LOGGED,'\\','\\\\') as USER_LOGGED, CS_DOMAIN
FROM MACHINE M
JOIN MACHINE_SOFTWARE_JT JT ON (JT.MACHINE_ID = M.ID)
JOIN SOFTWARE S ON (S.ID = JT.SOFTWARE_ID)
JOIN MACHINE_LABEL_JT ML ON (ML.MACHINE_ID = M.ID)
JOIN LABEL L ON (L.ID = ML.LABEL_ID)
WHERE DISPLAY_NAME like '%KB2661254%'
AND L.NAME = 'EMEA'
ORDER BY DISPLAY_NAME

Comments:
  • No Joy Im afraid. - garycox 12 years ago

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