pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

SQL pastebin - collaborative debugging tool View Help


Posted by Anonymous on Tue 21 Jul 18:44
report abuse | download | new post

  1. /*
  2.         Author: Trevor Sullivan
  3.        
  4.         Date: Tuesday, July 21st, 2009
  5.        
  6.         Purpose: Identify devices whose AMT hostname and OS hostname mismatch
  7.                         in the Configuration Manager database
  8.  
  9. */
  10.  
  11. SELECT
  12.         -- Active Directory site name
  13.         [AD_Site_Name0] AS 'AD SiteName'
  14.         -- AMT hostname (in provisioning record)
  15.         , [amt].[HostName] AS 'AMT HostName'
  16.         -- OS hostname (should match AMT firmware)
  17.         , [sys].[Name0] AS 'OS Hostname'
  18.         -- Retrieve UserID to identify device owner
  19.         , [UserName0] AS 'UserID'
  20.         -- Hardware vendor
  21.         , [cs].[Manufacturer0] AS 'Vendor'
  22.         -- Device model
  23.         , [cs].[Model0] AS 'Model0'
  24.  
  25. FROM v_AMTMachineInfo [amt]
  26.  
  27. -- Join v_R_System to retrieve AD Site Name field
  28. JOIN v_R_System [sys] ON [sys].[ResourceID] = [amt].[MachineID]
  29. -- Joinv_GS_Computer_System to allow us to retrieve make/model information
  30. JOIN v_GS_Computer_System [cs] ON [sys].[ResourceID] = [cs].[ResourceID]
  31.  
  32. WHERE
  33.         -- We only want current resource records from ConfigMgr
  34.         [sys].[Obsolete0] = 0
  35.         -- This condition determines the mismatching hostname in the v_R_System and v_AMTMachineInfo SQL views
  36.         AND [sys].[Name0] <> [amt].[HostName]

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post