Skip to content

Instantly share code, notes, and snippets.

Created November 30, 2018 00:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
SQL Query for the ConfigMgr Database which provides a summary of servers built in the last 31 days.
SELECT Distinct
GSSYS.Domain0 as 'Domain Name',
SYS.Name0 as 'Machine Name',
OS.Caption0 as 'OS',
OS.Description0 as 'Description',
GSSYS.SystemRole0 as 'Role',
OS.InstallDate0 as 'OS Install Date',
OS.TotalVisibleMemorySize0 as 'Allocated Memory',
CS.NumberOfProcessors0 as 'Allocated CPU'
v_R_System as SYS inner join v_GS_COMPUTER_SYSTEM as CS on CS.ResourceID = SYS.ResourceID
inner join v_GS_OPERATING_SYSTEM as OS on OS.ResourceID = SYS.ResourceID
inner join v_GS_SYSTEM as GSSYS on GSSYS.ResourceID = SYS.ResourceID
DATEDIFF(day,OS.InstallDate0,getdate()) < 31
GSSYS.SystemRole0 = 'Server'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment