| Author |
Topic  |
|
|
hh1234
Starting Member
30 Posts |
Posted - 03/14/2012 : 15:53:30
|
I have this code which works fine.
select distinct Name0, ResourceID, User_Domain0, User_Name0, AD_Site_Name0,
from v_R_System
where v_R_System.ResourceID NOT IN (Select v_R_System.ResourceID from v_R_System inner join v_GS_ADD_REMOVE_PROGRAMS on v_GS_Add_Remove_Programs.ResourceID = v_r_System.ResourceID where v_GS_ADD_REMOVE_PROGRAMS.DisplayName0 = '%Quest Secure Password Extension x64%')
I need to add this to the code:
SELECT LastConsoleUse0 From v_GS_SYSTEM_CONSOLE_USER
And then I need the LastConsoleUse0 to appear as a Column in the final output.
How do you do that?
|
|
|
tkizer
Almighty SQL Goddess
USA
35017 Posts |
|
|
hh1234
Starting Member
30 Posts |
Posted - 03/14/2012 : 16:06:20
|
NAME0 is the NetBIOS name of the PC. So I want LastConsoleUse0 (the last time a user logged on) associated with NAME0. That why we can tell for each machine the last time someone logged into the PC.
I hope that is what you were asking. |
 |
|
|
tkizer
Almighty SQL Goddess
USA
35017 Posts |
|
|
hh1234
Starting Member
30 Posts |
Posted - 03/14/2012 : 16:47:40
|
Name0 is from from v_R_System LastConsoleUse0 is from v_GS_SYSTEM_CONSOLE_USER
so they are from totally different views.
|
 |
|
|
tkizer
Almighty SQL Goddess
USA
35017 Posts |
|
|
hh1234
Starting Member
30 Posts |
Posted - 03/14/2012 : 17:00:07
|
I want to join these two statements
SELECT v_GS_COMPUTER_SYSTEM.Name0, v_GS_COMPUTER_SYSTEM.UserName0, v_R_System.User_Name0 FROM v_GS_COMPUTER_SYSTEM v_GS_COMPUTER_SYSTEM, v_R_System v_R_System WHERE v_R_System.ResourceID = v_GS_COMPUTER_SYSTEM.ResourceID ORDER BY v_GS_COMPUTER_SYSTEM.Name0
---------------------------------------------------------------------
select distinct Name0, ResourceID, User_Domain0, User_Name0, AD_Site_Name0,
from v_R_System
where v_R_System.ResourceID NOT IN (Select v_R_System.ResourceID from v_R_System inner join v_GS_ADD_REMOVE_PROGRAMS on v_GS_Add_Remove_Programs.ResourceID = v_r_System.ResourceID where v_GS_ADD_REMOVE_PROGRAMS.DisplayName0 = '%Quest Secure Password Extension x64%')
So I can find out all machines that do Not have the Quest software installed. I get the PC name and the last user who logged into the PC.
Thanks. |
 |
|
| |
Topic  |
|