Registered member login:
Register Now
Altirigos » Altiris Administrators » Reports » SQL Query for a report

» Current Poll
Do you leave the Aclient enabled?
YES - 82.51%
217 Votes
NO - 17.49%
46 Votes
Total Votes: 263
You may not vote on this poll.
» Stats
Members: 10,094
Threads: 12,231
Posts: 57,325
Top Poster: Nick (4,991)
Welcome our newest member, hussamdabit
» Online Users: 28
0 members and 28 guests
No Members online
Most users online at once 294, 06-30-2007 at 12:24 PM.
» September 2010
S M T W T F S
293031 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 12
Reply
Old 09-29-2006, 06:03 PM   #1 (permalink)
 
ksweet's Avatar
 
Status: Super Altiris Admin
Join Date: 06-14-2005
Location: USA
Posts: 429


Question SQL Query for a report

What table or tables holds the info for Sequential Software Delivery Tasks?
Whch Package \ Progams are assigned to it and thier order?

This will only show the SSD Tasks that have been enabled and assigned to a collection, But I also want to see the ones that have just been created and not enabled yet... There has to be another table to use then "Inv_Synch_Status"...

Code:
SELECT DISTINCT 
                      Item.Name AS [Sequential Task Name], SWDPackage.Name AS [Package Name], SWDProgram.Name AS [Program Name], 
                      SWDAdvertisement.Name AS [Advertisment Name]
FROM         Item INNER JOIN
                      Class ON Item.ClassGuid = Class.Guid INNER JOIN
                      SWDAdvertisement INNER JOIN
                      Inv_Synch_Status ON SWDAdvertisement.AdvertisementId = Inv_Synch_Status.TaskId INNER JOIN
                      SWDProgram ON SWDAdvertisement.ProgramId = SWDProgram.ProgramId INNER JOIN
                      SWDPackage ON SWDProgram.PackageId = SWDPackage.PackageId INNER JOIN
                      ItemReference ON Inv_Synch_Status.SynchronizationId = ItemReference.ChildItemGuid ON Item.Guid = ItemReference.ParentItemGuid
WHERE     (Class.Type = N'Altiris.NS.SWDWin32.SequentialSWD.SequentialSWDItem') AND (SWDAdvertisement._Latest = 1) AND (SWDProgram._Latest = 1) AND
                       (SWDPackage._Latest = 1) AND (ItemReference.Hint = N'sequentialswditem uses active synchronization item')
__________________
Till Midnight at the Well of Souls


ksweet is offline   Reply With Quote
Old 09-29-2006, 06:18 PM   #2 (permalink)
 
ksweet's Avatar
 
Status: Super Altiris Admin
Join Date: 06-14-2005
Location: USA
Posts: 429


Arrow VBScript Scan

VBScript I used to Scan Database to filnd tables that hold the GUIDs of the SSDTasks

My results...
GUID Found In Table Evt_NS_Item_Management Column ItemGuid
GUID Found In Table Evt_NS_Security_Descriptor_Change Column ItemGuid
GUID Found In Table Item Column Guid
GUID Found In Table Item Column SecurityGuid
GUID Found In Table ItemActive Column Guid
GUID Found In Table ItemCache Column ItemGuid
GUID Found In Table ItemFolder Column ItemGuid
GUID Found In Table ItemNameCache Column ItemGuid
GUID Found In Table ItemPresentation Column BaseGuid
GUID Found In Table ItemPresentation Column Guid
GUID Found In Table ItemReference Column ChildItemGuid
GUID Found In Table ItemReference Column ParentItemGuid
GUID Found In Table SecurityACE Column EntityGuid
GUID Found In Table SecurityACEChanged Column EntityGuid
GUID Found In Table SecurityEntity Column Guid
GUID Found In Table String Column BaseGuid
GUID Found In Table StringCacheRN Column BaseGuid

Code:
MyServer="Server"
MyLogon="UserID"
MyPassword="Password"

Set DBCon = CreateObject("ADODB.Connection") 
DBCon.Open "Provider=SQLOLEDB;uid=" & MyLogon & ";pwd=" & MyPassword & ";Data Source=" & MyServer & ";database=Altiris"

SQL = "SELECT Item.Guid FROM Item INNER JOIN Class ON Item.ClassGuid = Class.Guid WHERE (Class.Type = N'Altiris.NS.SWDWin32.SequentialSWD.SequentialSWDItem')"
Set TargetGUID = DBCon.Execute(SQL)
Do While TargetGUID.EOF = False
    MyGUID = TargetGUID.Fields("GUID").Value
    SQL = "SELECT sysobjects.name AS MyTable, syscolumns.name AS MyColumn FROM sysobjects INNER JOIN  syscolumns ON sysobjects.id = syscolumns.id WHERE (sysobjects.xtype = 'U') AND (syscolumns.xtype = 36) AND  (NOT (sysobjects.name LIKE N'xdls%') AND NOT (sysobjects.name LIKE N'xdlc%')) ORDER BY sysobjects.name, syscolumns.name"
    Set TableList = DBCon.Execute(SQL)
    Do While TableList.EOF = False
        SQL = "SELECT DISTINCT " & TableList.Fields("MyColumn").Value & " FROM " & TableList.Fields("MyTable").Value & " WHERE " & TableList.Fields("MyColumn").Value & " = '" & TargetGUID.Fields("GUID").Value & "'"
        Set GUIDSearch = DBCon.Execute(SQL)
        Do While GUIDSearch.EOF = False
            WScript.Echo "GUID " & TargetGUID.Fields("GUID").Value & " Found In Table " & TableList.Fields("MyTable").Value & " Column " & TableList.Fields("MyColumn").Value
            GUIDSearch.MoveNext
        Loop
        TableList.MoveNext
    Loop
    TargetGUID.MoveNext
Loop

DBCon.Close

Set DBCon = Nothing 
Set TargetGUID = Nothing
Set TableList = Nothing
Set GUIDSearch = Nothing
__________________
Till Midnight at the Well of Souls


ksweet is offline   Reply With Quote
Old 10-03-2006, 05:38 PM   #3 (permalink)
 
ksweet's Avatar
 
Status: Super Altiris Admin
Join Date: 06-14-2005
Location: USA
Posts: 429


Lightbulb any one have info on this?

any one have info on this?
__________________
Till Midnight at the Well of Souls


ksweet is offline   Reply With Quote
Old 10-04-2006, 06:27 AM   #4 (permalink)
 
Status: Altiris Engineer (Super Mod)
Join Date: 03-23-2005
Location: Belgium
Posts: 251


If I'm not mistaken, this information is stored only in the state field in the Item table for the Synchronisation Task related to the Sequential Software Delivery Task.

You can get the xml that describes the task as follows :

select i.State
from Item
join ItemReference ir on i.Guid=ir.ChildItemGuid
where ParentItemGuid={GUID-OF-THE-SEQUENTIAL-SOFTWARE-TASK}
and hint='sequentialswditem uses active synchronization item'

You could write a small vbs that performs this query and saves the xml in a file. Then you could use "normal" xml-processing code to process the item\Synchronization\Tasks key.
__________________
Tom
Tom.Reyntjens is offline   Reply With Quote
Old 10-04-2006, 12:10 PM   #5 (permalink)
 
ksweet's Avatar
 
Status: Super Altiris Admin
Join Date: 06-14-2005
Location: USA
Posts: 429


Angry no wonder...

No wonder I couldn't find it... Well there goes the reports I wanted to write to view all Sequential SWD Tasks...
__________________
Till Midnight at the Well of Souls


ksweet is offline   Reply With Quote
Old 10-04-2006, 06:14 PM   #6 (permalink)
 
Status: Altiris Engineer (Super Mod)
Join Date: 03-23-2005
Location: Belgium
Posts: 251


Unless of course you create your own table with Sequential Task information, and schedule a script to update that table regularly using a combination of the query and the XML-parsing. Shouldn't be too hard
__________________
Tom
Tom.Reyntjens is offline   Reply With Quote
Old 10-05-2006, 11:52 AM   #7 (permalink)
 
ksweet's Avatar
 
Status: Super Altiris Admin
Join Date: 06-14-2005
Location: USA
Posts: 429


Talking

Quote:
Originally Posted by Tom.Reyntjens
Unless of course you create your own table with Sequential Task information, and schedule a script to update that table regularly using a combination of the query and the XML-parsing. Shouldn't be too hard
No it wouldn't, but I am that lazy...
__________________
Till Midnight at the Well of Souls


ksweet is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -4. The time now is 10:47 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
vB.Sponsors
Altirigos