Friday 20 March 2009

What Primary Lookup Key should I use with Deployment Server?

If you choose a Primary Lookup Key that is identical on two or more of your computers or if that key is missing on any of your computers, Deployment Server will not be able to identify them. To identify which Primary Lookup Key is best, open SQL Query Analyzer, select to the Deployment Server database, and run the the query against the Deployment Server database. The result will tell you which keys have duplicate computers and which ones don't. It will also show you which keys have duplicates.

DECLARE @sn INT SET @sn=(SELECT COUNT(1) FROM (SELECT T.serial_num AS [Serial Number], T.duplicates AS [Duplicates], C.computer_id AS [Computer ID], C.name AS [Console Name], C.computer_name AS [Computer Name] FROM computer C, (SELECT COUNT(1) AS duplicates, serial_num FROM computer GROUP BY serial_num HAVING COUNT(1) > 1) T WHERE C.serial_num = T.serial_num) T )
DECLARE @at INT SET @at=(SELECT COUNT(1) FROM (SELECT T.asset_tag AS [Asset Tag], T.duplicates AS [Duplicates], C.computer_id AS [Computer ID], C.name AS [Console Name], C.computer_name AS [Computer Name] FROM computer C, (SELECT COUNT(1) AS duplicates, asset_tag FROM computer GROUP BY asset_tag HAVING COUNT(1) > 1) T WHERE C.asset_tag = T.asset_tag) T )
DECLARE @uuid INT SET @uuid=(SELECT COUNT(1) FROM (SELECT T.uuid AS [UUID], T.duplicates AS [Duplicates], C.computer_id AS [Computer ID], C.name AS [Console Name], C.computer_name AS [Computer Name] FROM computer C, (SELECT COUNT(1) AS duplicates, uuid FROM computer GROUP BY uuid HAVING COUNT(1) > 1) T WHERE C.uuid = T.uuid) T )
DECLARE @mac INT SET @mac=(SELECT COUNT(1) FROM (SELECT T.mac_addr AS [MAC Address], T.duplicates AS [Duplicates], N.computer_id AS [Computer ID], C.name AS [Console Name], C.computer_name AS [Computer Name] FROM nics N, (SELECT COUNT(1) AS duplicates, mac_addr FROM nics GROUP BY mac_addr HAVING COUNT(1) > 1) T, computer C WHERE N.mac_addr = T.mac_addr AND C.computer_id = N.computer_id) T )

IF @sn = 0
  SELECT 'Serial Number OK' AS Message, 'You may use Serial Number as your Primary Lookup Key' AS Details
ELSE
  SELECT 'You have computers with duplicate Serial Numbers' AS Warning, 'Do not use Serial Number as your Primary Lookup Key' AS Details
IF @at = 0
  SELECT 'Asset Tag OK' AS Message, 'You may use Asset Tag as your Primary Lookup Key' AS Details
ELSE
  SELECT 'You have computers with duplicate Asset Tags' AS Warning, 'Do not use Asset Tag as your Primary Lookup Key' AS Details
IF @uuid = 0
  SELECT 'UUID OK' AS Message, 'You may use UUID as your Primary Lookup Key' AS Details
ELSE
  SELECT 'You have computers with duplicate UUIDs' AS Warning, 'Do not use UUID as your Primary Lookup Key' AS Details
IF @mac = 0
  SELECT 'MAC Address OK' AS Message, 'You may use MAC Address as your Primary Lookup Key' AS Details
ELSE
  SELECT 'You have computers with duplicate MAC Addresses' AS Warning, 'Do not use MAC Address as your Primary Lookup Key' AS Details

SELECT T.serial_num AS [Serial Number], T.duplicates AS [Duplicates], C.computer_id AS [Computer ID], C.name AS [Console Name], C.computer_name AS [Computer Name] FROM computer C, (SELECT COUNT(1) AS duplicates, serial_num FROM computer GROUP BY serial_num HAVING COUNT(1) > 1) T WHERE C.serial_num = T.serial_num
SELECT T.asset_tag AS [Asset Tag], T.duplicates AS [Duplicates], C.computer_id AS [Computer ID], C.name AS [Console Name], C.computer_name AS [Computer Name] FROM computer C, (SELECT COUNT(1) AS duplicates, asset_tag FROM computer GROUP BY asset_tag HAVING COUNT(1) > 1) T WHERE C.asset_tag = T.asset_tag
SELECT T.uuid AS [UUID], T.duplicates AS [Duplicates], C.computer_id AS [Computer ID], C.name AS [Console Name], C.computer_name AS [Computer Name] FROM computer C, (SELECT COUNT(1) AS duplicates, uuid FROM computer GROUP BY uuid HAVING COUNT(1) > 1) T WHERE C.uuid = T.uuid
SELECT T.mac_addr AS [MAC Address], T.duplicates AS [Duplicates], N.computer_id AS [Computer ID], C.name AS [Console Name], C.computer_name AS [Computer Name] FROM nics N, (SELECT COUNT(1) AS duplicates, mac_addr FROM nics GROUP BY mac_addr HAVING COUNT(1) > 1) T, computer C WHERE N.mac_addr = T.mac_addr AND C.computer_id = N.computer_id

During the Altiris Agent Installation window I get the following error: 'The following error occurred on the page InstallClient.aspx: Failed to Render the control'

Problem/Symptoms

During the Altiris Agent Installation window I get the following error:
The following error occurred on the page 'InstallClient.aspx: Failed to Render the control'
In the logs, the error looks like this one:
Priority: 1
Date: 10/4/2006 9:44:34 AM
Tick Count: 183687687
Host Name: NSServer
Process: w3wp.exe (4592)
Thread ID: 7528
Module: AltirisNativeHelper.dll
Source: global.asax
Description: Unhandled exception.  Type=Altiris.NS.Exceptions.AeXException Msg=Failed to render the control.
StackTrace=
   at Altiris.NS.UI.Controls.CollectionPickerCtrl.Render(HtmlTextWriter output)
   ....(obmitted section)

Inner exception.  Type=Altiris.NS.Exceptions.AeXException Msg=Failed to get the names of the selected collections.

Inner exception.  Type=Altiris.NS.Exceptions.AeXException Msg=Failed to fetch Collection datarow from database. No rows returned.

Looking on the Notification Server logs, you may find another error like this one close to the error above:
Priority: 1
Date: 10/4/2006 9:45:01 AM
Tick Count: 183715343
Host Name: NSServer
Process: aexsvc.exe (1740)
Thread ID: 6720
Module: AltirisNativeHelper.dll
Source:
Altiris.NS.StandardItems.Collection.DeltaCollectionUpdateSchedule
Description: Error occurred during delta collection updating: Altiris.NS.Exceptions.AeXException: Failed to fetch Collection datarow from database. No rows returned.

Resolution

For this error, The following error occurred on the page 'InstallClient.aspx', please try the following article:
Article ID: 18945 "Object reference not set to an instance of an object—Altiris Agent Installation Page"

If you still get the same error please try the following:
--Use the following query to find out if any defined collections are missing from Collection table:

select guid, name
from item
where classguid in
    (
    select distinct classguid
    from item
    where guid in
    (select guid from collection)
    ) and
      guid not in
       (select guid from collection)

--Use the following SQL query to move missing collections into a temporary table to be used for an insert into the Collection table.  This should resolve the collection inconsistencies causing the errors:

SELECT Guid, '34BE747F-C855-4F8F-93E7-50176076A200' as LegacySolutionGroupGuid, createddate, modifieddate into #t
FROM Item WHERE Guid in
    (select guid
    from item
    where classguid in
        (
        select distinct classguid
        from item
        where guid in
        (select guid from collection)
        ) and
          guid not in
           (select guid from collection)
    )
begin tran
insert into collection (Guid, LegacySolutionGroupGuid, CreatedDate, ModifiedDate)
  select Guid, LegacySolutionGroupGuid, CreatedDate, ModifiedDate from #t
commit tran
drop table #t