» Site Navigation |
|
|
» Stats |
Members: 6,845
Threads: 9,786
Posts: 47,851
Top Poster: Nick (4,800)
|
| Welcome our newest member, suresh |
» January 2009 |
| S |
M |
T |
W |
T |
F |
S |
| 28 | 29 | 30 | 31 |
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
|
|
 |
11-26-2008, 09:56 AM
|
#1 (permalink)
|
Status: Junior Altiris Admin
Join Date: 11-23-2008
Location: New Zealand
Posts: 8
|
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
|
|
|
11-26-2008, 11:51 AM
|
#2 (permalink)
|
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
|
|
|
11-26-2008, 11:59 AM
|
#3 (permalink)
|
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
|
|
|
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)
|
|
|
11-26-2008, 12:38 PM
|
#5 (permalink)
|
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
|
|
|
11-26-2008, 03:11 PM
|
#6 (permalink)
|
Status: Junior Altiris Admin
Join Date: 11-23-2008
Location: New Zealand
Posts: 8
|
I cant seem to get the Syntax right, I anxiously await the results of testing on the above, Thanks
|
|
|
11-26-2008, 03:24 PM
|
#7 (permalink)
|
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
|
|
|
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.
|
|
|
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
|
|
|
12-01-2008, 05:42 AM
|
#10 (permalink)
|
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
|
|
|
12-01-2008, 05:50 AM
|
#11 (permalink)
|
Status: Sticky...
Join Date: 03-04-2005
Location: Culver City, CA
Age: 52
Posts: 3,347
|
Quote:
Originally Posted by nigel.gibb
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
|
|
|
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 :-)
|
|
|
12-01-2008, 09:29 AM
|
#13 (permalink)
|
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
|
|
|
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
|
|
|
12-01-2008, 09:46 AM
|
#15 (permalink)
|
Status: Sticky...
Join Date: 03-04-2005
Location: Culver City, CA
Age: 52
Posts: 3,347
|
|
|
|
 |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|