Registered member login:
Register Now
Altirigos » Notification Server and Solutions » Notification Server » Collection Based on OS install Date

» Current Poll
Vista?
Staying on XP until Windows 7 - 72.03%
103 Votes
Already on Vista - 10.49%
15 Votes
Planning an upgrade to Vista soon - 10.49%
15 Votes
Other (please explain) - 6.99%
10 Votes
Total Votes: 143
You may not vote on this poll.
» Stats
Members: 6,845
Threads: 9,786
Posts: 47,851
Top Poster: Nick (4,800)
Welcome our newest member, suresh
» Online Users: 49
6 members and 43 guests
Carl_Larsson, damadi, jebba, madj42, skakid, stewfo
Most users online at once 294, 06-30-2007 at 01:24 PM.
» January 2009
S M T W T F S
28293031 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 31
Reply
Old 11-26-2008, 09:56 AM   #1 (permalink)
 
Status: Junior Altiris Admin
Join Date: 11-23-2008
Location: New Zealand
Posts: 8


Question Collection Based on OS install Date

Hi,

Can anyone advise on how to create a collection based on OS install Date.

I want to create a collection of PC's that are in the Deployment Stage e.g. OS is less than 8hrs old.

The Reason for this is so I can ensure that my sequestial SWD Tasks designed for install of Core Apps post initial Deployment (DS) only run on PC's that are in the Deployment Stage

Many Thanks
nigel.gibb is offline   Reply With Quote
Old 11-26-2008, 11:51 AM   #2 (permalink)
 
dominique's Avatar
 
Status: Sticky...
Join Date: 03-04-2005
Location: Culver City, CA
Age: 52
Posts: 3,347


Hello,

You could try to create a
Software Management > Application Metering > Application Discovery > Newly Discovered Applications

Clone the report
Add the Guid
Create a dynamic collection on this report

I will give a try this week-end but these are ideas..

Thanks
__________________
Thanks
Dom
http://www.altirigos.com

"Helping somebody else may help you"
dominique is offline   Reply With Quote
Old 11-26-2008, 11:59 AM   #3 (permalink)
 
dominique's Avatar
 
Status: Sticky...
Join Date: 03-04-2005
Location: Culver City, CA
Age: 52
Posts: 3,347


Something like this:
Quote:
SELECT DISTINCT
da.[ProductName] [Application],
i.[Name],
i.[_ResourceGuid] [ResourceGuid],
i.[Domain],
MAX(da.[Discovery Date]) [Discovery Date]
FROM dbo.Evt_AeX_Discovered_Applications da
JOIN dbo.Inv_AeX_AC_Identification i
ON i.[_ResourceGuid] = da.[_ResourceGuid]
WHERE 1 = 1
AND da.[ProductName] Like '%Microsoft® Windows® Operating System%'
AND DATEDIFF([hh,da.[Discovery Date],GETDATE()) <= 8
AND da.[ProductName] IS NOT NULL
AND da.[ProductName] <> ''
GROUP BY
da.[ProductName],
i.[Name],
i.[_ResourceGuid],
i.[Domain]
ORDER BY
i.[Domain],
i.[Name]
Thanks
__________________
Thanks
Dom
http://www.altirigos.com

"Helping somebody else may help you"
dominique is offline   Reply With Quote
Old 11-26-2008, 12:24 PM   #4 (permalink)
 
Status: Junior Altiris Admin
Join Date: 11-23-2008
Location: New Zealand
Posts: 8


Thanks for your reply Dom

Test Fails with error: The datediff function requires 3 argument(s)
nigel.gibb is offline   Reply With Quote
Old 11-26-2008, 12:38 PM   #5 (permalink)
 
dominique's Avatar
 
Status: Sticky...
Join Date: 03-04-2005
Location: Culver City, CA
Age: 52
Posts: 3,347


opps sorry my mistake
remove the [ in front of the hh
Quote:
SELECT DISTINCT
da.[ProductName] [Application],
i.[Name],
i.[_ResourceGuid] [ResourceGuid],
i.[Domain],
MAX(da.[Discovery Date]) [Discovery Date]
FROM dbo.Evt_AeX_Discovered_Applications da
JOIN dbo.Inv_AeX_AC_Identification i
ON i.[_ResourceGuid] = da.[_ResourceGuid]
WHERE 1 = 1
AND da.[ProductName] Like '%Microsoft® Windows® Operating System%'
AND DATEDIFF(hh,da.[Discovery Date],GETDATE()) <= 8
AND da.[ProductName] IS NOT NULL
AND da.[ProductName] <> ''
GROUP BY
da.[ProductName],
i.[Name],
i.[_ResourceGuid],
i.[Domain]
ORDER BY
i.[Domain],
i.[Name]
Thanks
__________________
Thanks
Dom
http://www.altirigos.com

"Helping somebody else may help you"
dominique is offline   Reply With Quote
Old 11-26-2008, 03:11 PM   #6 (permalink)
 
Status: Junior Altiris Admin
Join Date: 11-23-2008
Location: New Zealand
Posts: 8


Unhappy

I cant seem to get the Syntax right, I anxiously await the results of testing on the above, Thanks
nigel.gibb is offline   Reply With Quote
Old 11-26-2008, 03:24 PM   #7 (permalink)
 
dominique's Avatar
 
Status: Sticky...
Join Date: 03-04-2005
Location: Culver City, CA
Age: 52
Posts: 3,347


Hello,

Which error do you get? For me this one works, so it could be the copy/paste which change some space but otherwise it should be okay.

Which message do you have?

Thanks
__________________
Thanks
Dom
http://www.altirigos.com

"Helping somebody else may help you"
dominique is offline   Reply With Quote
Old 11-26-2008, 10:01 PM   #8 (permalink)
 
Status: Super Altiris Admin
Join Date: 11-09-2006
Location: London
Posts: 570


I think there's a "Client date" field or similar in the AeX_AC_Identification tble in Basic Inventory. This may populate your collections quicker when you use Dom's syntax with this date.
andykn is offline   Reply With Quote
Old 11-30-2008, 03:46 PM   #9 (permalink)
 
Status: Junior Altiris Admin
Join Date: 11-23-2008
Location: New Zealand
Posts: 8


After getting my head around this error...

An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference.


I have this query giving me what on the surface seems like an accurate collection based on the vCOMPUTER create date.

select Guid from vCOMPUTER
WHERE vCOMPUTER.[OS NAME] = 'Microsoft Windows XP'
GROUP BY GUID
HAVING datediff(hh,min(vCOMPUTER.[CreatedDate]),getdate()) <= '8'

I hope to get something more accurate olong the lines of the above working but my SQL knowledge is crap
nigel.gibb is offline   Reply With Quote
Old 12-01-2008, 05:42 AM   #10 (permalink)
 
dominique's Avatar
 
Status: Sticky...
Join Date: 03-04-2005
Location: Culver City, CA
Age: 52
Posts: 3,347


I ran both queries and they both works.
see the screenshot, the first one is giving a list, the result of the second one is empty...

Thanks
Attached Files
File Type: zip Queries- Inventory.zip (132.5 KB, 1 views)
__________________
Thanks
Dom
http://www.altirigos.com

"Helping somebody else may help you"
dominique is offline   Reply With Quote
Old 12-01-2008, 05:50 AM   #11 (permalink)
 
dominique's Avatar
 
Status: Sticky...
Join Date: 03-04-2005
Location: Culver City, CA
Age: 52
Posts: 3,347


Quote:
Originally Posted by nigel.gibb View Post
After getting my head around this error...

An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference.

I have this query giving me what on the surface seems like an accurate collection based on the vCOMPUTER create date.

select Guid from vCOMPUTER
WHERE vCOMPUTER.[OS NAME] = 'Microsoft Windows XP'
GROUP BY GUID
HAVING datediff(hh,min(vCOMPUTER.[CreatedDate]),getdate()) <= '8'

I hope to get something more accurate olong the lines of the above working but my SQL knowledge is crap
The error might ciome when you run the Select statement with Created date something like:
[q]
select Guid, [CreatedDate] from vCOMPUTER
WHERE vCOMPUTER.[OS NAME] = 'Microsoft Windows XP'
GROUP BY GUID
HAVING datediff(hh,min(vCOMPUTER.[CreatedDate]),getdate()) <= '8'
[/q]

If so you need to update your query as:
[q]
select Guid, [CreatedDate] from vCOMPUTER
WHERE vCOMPUTER.[OS NAME] = 'Microsoft Windows XP'
GROUP BY GUID, [Created Date]
HAVING datediff(hh,min(vCOMPUTER.[CreatedDate]),getdate()) <= '8'
[/q]

Thanks
__________________
Thanks
Dom
http://www.altirigos.com

"Helping somebody else may help you"
dominique is offline   Reply With Quote
Old 12-01-2008, 08:58 AM   #12 (permalink)
 
Status: Junior Altiris Admin
Join Date: 11-23-2008
Location: New Zealand
Posts: 8


It seems the syntax checking in SQL Query Analyser and the NS Collection creator are different.

When I run your query in SQL it works. (but shows no results?)

If I run it in NS Console I get this error..... The condition applied to this collection contains an ORDER BY clause without a corresponding TOP clause. Conditions require the use of both of these clauses, or neither of them to function correctly. Please modify the condition appropriately.


I'm starting to get a headache :-)
nigel.gibb is offline   Reply With Quote
Old 12-01-2008, 09:29 AM   #13 (permalink)
 
dominique's Avatar
 
Status: Sticky...
Join Date: 03-04-2005
Location: Culver City, CA
Age: 52
Posts: 3,347


Hello Nigel,

Remove the order clause and it will work
[q]
SELECT DISTINCT
da.[ProductName] [Application],
i.[Name],
i.[_ResourceGuid] [ResourceGuid],
i.[Domain],
MAX(da.[Discovery Date]) [Discovery Date]
FROM dbo.Evt_AeX_Discovered_Applications da
JOIN dbo.Inv_AeX_AC_Identification i
ON i.[_ResourceGuid] = da.[_ResourceGuid]
WHERE 1 = 1
AND da.[ProductName] Like '%Microsoft® Windows® Operating System%'
AND DATEDIFF(hh,da.[Discovery Date],GETDATE()) <= 8
AND da.[ProductName] IS NOT NULL
AND da.[ProductName] <> ''
GROUP BY
da.[ProductName],
i.[Name],
i.[_ResourceGuid],
i.[Domain]
[/q]

Thanks
__________________
Thanks
Dom
http://www.altirigos.com

"Helping somebody else may help you"
dominique is offline   Reply With Quote
Old 12-01-2008, 09:35 AM   #14 (permalink)
 
Status: Junior Altiris Admin
Join Date: 11-23-2008
Location: New Zealand
Posts: 8


That got it.

Thanks for your Help DOM
nigel.gibb is offline   Reply With Quote
Old 12-01-2008, 09:46 AM   #15 (permalink)
 
dominique's Avatar
 
Status: Sticky...
Join Date: 03-04-2005
Location: Culver City, CA
Age: 52
Posts: 3,347


__________________
Thanks
Dom
http://www.altirigos.com

"Helping somebody else may help you"
dominique 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 09:52 AM.


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