Hey all, looking to get a little help with the removal of software based on an LDAP label.

There are two parts of this. The first is installing the software automatically based on an LDAP label when a user is added to the specific AD security group. That one works great. Here's the SQL for that.

SELECT 
    MACHINE.NAME,
    MACHINE.OS_NAME,
    MACHINE.USER_NAME,
    MACHINE.USER_FULLNAME
FROM
    LABEL L
        LEFT JOIN
    USER_LABEL_JT ON (USER_LABEL_JT.LABEL_ID = L.ID)
        LEFT JOIN
    USER U ON (U.ID = USER_LABEL_JT.USER_ID)
        LEFT JOIN
    MACHINE ON (MACHINE.USER_NAME = U.USER_NAME)
WHERE
    ((L.NAME LIKE 'MemberOf - LDAP USER LABEL HERE')
        AND (NOT EXISTS( SELECT 
            1
        FROM
            SOFTWARE,
            MACHINE_SOFTWARE_JT
        WHERE
            MACHINE_SOFTWARE_JT.MACHINE_ID = MACHINE.ID
                AND SOFTWARE.ID = MACHINE_SOFTWARE_JT.SOFTWARE_ID
                AND SOFTWARE.DISPLAY_NAME = 'SOFTWARE 1')))

The issue that I am trying to solve is essentially reversing the label so that when a user is removed from the AD security group and subsequently no long in the LDAP label that the software automatically gets removed. I would think that this should be as simple as (If software exists and label does not then do something). However despite my best efforts is just is not working as I believe it should.

Any help here would be much appreciated.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

There are no answers at this time

Answers

Answer this question or Comment on this question for clarity