SCCM – SQL Queries

SCCM – SQL Queries

Read Time:17 Minute, 21 Second

Anda dapat mencoba queri SQL Anda di SQL Server Management Studio atau WQL di bawah node CM Queries.

Create SQL Query in SQL Server Management Studio

Create SQL Query in SQL Server Management Studio

WQL Queries

* tested in the SCCM Console, under the Queries node

* many other queries in PDF


Return Specific Windows Build Version

SELECT DISTINCT
SMS_R_System.NetbiosName, SMS_G_System_OPERATING_SYSTEM.BuildNumber
FROM
SMS_R_System
INNER JOIN SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId
WHERE SMS_G_System_OPERATING_SYSTEM.BuildNumber = "16299" and SMS_R_System.OperatingSystemNameandVersion like "%Workstation%"

Join System, User, and Computer_System…return data

SELECT v_R_System.Name0,v_R_System.Operating_System_Name_and0, v_R_User.User_Name0,v_R_User.displayName0,v_R_User.Mail0, v_GS_COMPUTER_SYSTEM.Model0
FROM v_R_System
INNER JOIN v_R_User ON v_R_User.User_Name0 = v_R_System.User_Name0
INNER JOIN v_GS_COMPUTER_SYSTEM ON v_GS_COMPUTER_SYSTEM.ResourceID = v_R_System.ResourceId

Return Machines with PST Data

select distinct
SMS_R_System.Name,
SMS_G_System_SoftwareFile.FileName,
SMS_G_System_SoftwareFile.FilePath,
SMS_G_System_SoftwareFile.FileSize,
SMS_G_System_SoftwareFile.ModifiedDate
from
SMS_R_System
inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId
where
SMS_G_System_SoftwareFile.FileName like "%.pst%"

 Join SMS_R_System and SMS_R_User: Post

SELECT * FROM SMS_R_System INNER JOIN SMS_R_User ON SMS_R_User.Username = SMS_R_System.LastLogonUserName

SQL Queries

* tested in SQL Server Management Studio

Return Maintenance Windows General Info

SELECT c.Name, c.Comment,SW.IsEnabled, SW.CollectionID, c.MemberCount, SW.Description, SW.StartTime, SW.Duration
FROM v_ServiceWindow SW
JOIN v_Collection C ON C.CollectionID = SW.CollectionID
ORDER BY c.Name

Return ResourceID, Email Address, Computer Name

SELECT v_R_User.ResourceID, User_Principal_Name0, v_GS_COMPUTER_SYSTEM.Name0
FROM v_GS_COMPUTER_SYSTEM
LEFT JOIN v_R_User ON v_GS_COMPUTER_SYSTEM.UserName0 = v_R_User.Unique_User_Name0

Return Collection ID from Software Name

select distinct
v_Collection.Name as 'Software Name',
v_Collection.CollectionID
from v_Collection
join vSMS_CollectionDependencies on vSMS_CollectionDependencies.DependentCollectionID = v_Collection.CollectionID
where v_Collection.Name = 'Visio Pro 2019'

Return Collection Name from Collection ID

select distinct
v_Collection.Name as 'Software Name',
v_Collection.CollectionID
from v_Collection
join vSMS_CollectionDependencies on vSMS_CollectionDependencies.DependentCollectionID = v_Collection.CollectionID
where v_Collection.CollectionID = 'ABC00188'

Return SCCM Folders with IDs

select vsms_folders.Name as[FolderName], vFolderMembers.ContainerNodeID as [FolderID]
from vcollections
inner join vFolderMembers
on vCollections.siteid = vFolderMembers.InstanceKey
inner join vsms_folders
on vFolderMembers.ContainerNodeID = vSMS_Folders.ContainerNodeID

Return All Collections Inside a Specific Folder

select vcollections.siteid as [Software Title], vcollections.collectionname as [CollectionName], vsms_folders.Name as[FolderName], vFolderMembers.ContainerNodeID as [FolderID]
from vcollections
inner join vFolderMembers
on vCollections.siteid = vFolderMembers.InstanceKey
inner join vsms_folders
on vFolderMembers.ContainerNodeID = vSMS_Folders.ContainerNodeID
where vFolderMembers.ContainerNodeID = '12345678'
ORDER BY
'Software Title'

Return Computer and User

SELECT sys.Netbios_Name0, TopConsoleUser0
FROM v_R_System sys
LEFT OUTER JOIN v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP um
ON um.ResourceID = sys.ResourceID
WHERE TopConsoleUser0 IS NOT NULL
ORDER BY sys.Netbios_Name0

Return All Available Packages

SELECT
Program.PackageID,
Package.Name 'Package',
Program.ProgramName 'Type',
Program.CommandLine,
Program.Comment,
Program.Description,
Package.PkgSourcePath
FROM
[v_Program] as Program
LEFT JOIN
v_Package as Package on Package.PackageID = Program.PackageID
WHERE Program.ProgramName != '*'
--WHERE Program.ProgramName = 'Install'
ORDER BY
Package.Name

Create Custom Report with operating systems and serials

SELECT DISTINCT
a.ResourceID,
a.Name0 AS[Name],
a.User_Name0 AS[Username],
b.System_OU_Name0,
a.Last_Logon_Timestamp0 AS[Last Logon],
c.Manufacturer00 AS [Manufacturer],
c.SerialNumber00 AS[Serial],
c.SMBIOSAssetTag00 AS[Asset],
d.Caption00 AS[OS],
d.InstallDate00 AS[Install Date],
e.SMBIOSBIOSVersion00 AS[BIOS],
f.Model00 AS[Model]
 
FROM
v_R_System a
 
LEFT OUTER JOIN
System_System_OU_Name_ARR b ON b.ItemKey = b.ItemKey
INNER JOIN
System_Enclosure_DATA c ON c.MachineID = a.ResourceID
INNER JOIN
Operating_System_DATA d ON d.MachineID = a.ResourceID
INNER JOIN
PC_BIOS_DATA e ON e.MachineID = a.ResourceID
INNER JOIN
Computer_System_DATA f ON f.MachineID = a.ResourceID

Computers that have 30+ days old hardware information

SELECT
a.ResourceID,
a.Netbios_name0 AS[Name],
b.LastHWScan
FROM
v_R_System a
INNER JOIN
v_GS_WORKSTATION_STATUS b
ON
a.ResourceID = b.ResourceID
WHERE
b.LastHWScan <= Dateadd(day, -30, getdate())

Computers that have 30 days or less hardware information

SELECT
a.ResourceID,
a.Netbios_name0 AS[Name],
b.LastHWScan
FROM
v_R_System a
INNER JOIN
v_GS_WORKSTATION_STATUS b
ON
a.ResourceID = b.ResourceID
WHERE
b.LastHWScan >= Dateadd(day, -30, getdate())

Collection of clients not approved

SELECT
a.ResourceID,
a.Netbios_name0 AS[Name],
a.ResourceType,
a.SMS_Unique_Identifier0 AS[UniqueID],
a.Resource_Domain_OR_Workgr0 AS[Domain],
a.Client0,
b.IsApproved
FROM
v_R_System a
INNER JOIN
v_CM_RES_COLL_SMS00001 b
ON
a.ResourceID = b.ResourceID
WHERE
b.IsApproved = '2'

Collection of clients that have been approved

SELECT
a.ResourceID,
a.Netbios_name0 AS[Name],
a.ResourceType,
a.SMS_Unique_Identifier0 AS[UniqueID],
a.Resource_Domain_OR_Workgr0 AS[Domain],
a.Client0,
b.IsApproved
FROM
v_R_System a
INNER JOIN
v_CM_RES_COLL_SMS00001 b
ON
a.ResourceID = b.ResourceID
WHERE
b.IsApproved = '1'

Collection of clients requiring a reboot

SELECT
SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name0,
SMS_R_SYSTEM.SMS_Unique_Identifier0,
SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,
SMS_R_SYSTEM.Client0
FROM
v_R_System AS SMS_R_SYSTEM
INNER JOIN
vSMS_Update_ComplianceStatus AS c
ON
c.MachineID=SMS_R_SYSTEM.ResourceID
WHERE
c.LastEnforcementMessageID = 9

Collection of ConfigMgr clients waiting for another installation to finish

SELECT
SMS_R_SYSTEM.ResourceID AS[ResourceID],
SMS_R_SYSTEM.ResourceType AS[Type],
SMS_R_SYSTEM.Name0 AS[Name],
SMS_R_SYSTEM.SMS_Unique_Identifier0 AS[UniqueID],
SMS_R_SYSTEM.Resource_Domain_OR_Workgr0 AS[Domain],
SMS_R_SYSTEM.Client0 AS[Name]
FROM
v_R_System AS SMS_R_System
INNER JOIN
vSMS_Update_ComplianceStatus AS c
ON
c.MachineID=SMS_R_System.ResourceID
WHERE
c.LastEnforcementMessageID = 3

Return list of computers with C: drive space great than 100 MB

1234567891011121314151617SELECTa.ResourceID,a.ResourceType AS[ResourceID],a.Name0 AS[Name],a.SMS_Unique_Identifier0 AS[UniqueID],a.Resource_Domain_OR_Workgr0 AS[Domain],a.Client0,b.DeviceID0 AS[DriveLetter],b.Size0 AS[Size]FROMv_R_System aINNERJOINv_GS_LOGICAL_DISK bONa.ResourceID = b.ResourceIdWHEREb.DeviceID0 = 'C:'AND((b.Size0)> 100)

All SCCM client computers with less than 1 GB free disk space on C:

123456789101112131415161718SELECTa.ResourceID,a.ResourceType AS[ResourceType],a.Name0 AS[Name],a.SMS_Unique_Identifier0 AS[UniqueID],a.Resource_Domain_OR_Workgr0 AS[Domain],a.Client0,b.DeviceID0 AS[DriveLetter],b.FreeSpace0 AS[FreeSpace],b.Size0 AS[Size]FROMv_R_System aINNERJOINv_GS_LOGICAL_DISK bONa.ResourceID = b.ResourceIdWHEREb.DeviceID0 = 'C:'AND((b.FreeSpace0) > 1000)

All SCCM client computers with less than 10 GB free disk space on C:

123456789101112131415161718SELECTa.ResourceID,a.ResourceType AS[ResourceType],a.Name0 AS[Name],a.SMS_Unique_Identifier0 AS[UniqueID],a.Resource_Domain_OR_Workgr0 AS[Domain],a.Client0,b.DeviceID0 AS[DriveLetter],b.FreeSpace0 AS[FreeSpace],b.Size0 AS[Size]FROMv_R_System aINNERJOINv_GS_LOGICAL_DISK bONa.ResourceID = b.ResourceIdWHEREb.DeviceID0 = 'C:'AND((b.FreeSpace0)< 10000)

All SCCM client computers with greater than 50 GB free disk space on C:

123456789101112131415161718SELECTa.ResourceID,a.ResourceType AS[ResourceID],a.Name0 AS[Name],a.SMS_Unique_Identifier0 AS[UniqueID],a.Resource_Domain_OR_Workgr0 AS[Domain],a.Client0,b.DeviceID0 AS[DriveLetter],b.FreeSpace0 AS[FreeSpace],b.Size0 AS[Size]FROMv_R_System aINNERJOINv_GS_LOGICAL_DISK bONa.ResourceID = b.ResourceIdWHEREb.DeviceID0 = 'C:'AND((b.FreeSpace0)> 50000)

All computer objects with client installed in the specific site “001”

12345678910111213SELECTa.ResourceID AS[ResourceID],a.Name0 AS[Name],a.Client0,b.SMS_Installed_Sites0 AS[SiteCode]FROMv_R_System aLEFTOUTERJOINv_RA_System_SMSInstalledSites bONa.ResourceID = b.ResourceIDWHEREb.SMS_Installed_Sites0 = '001'ANDa.Client0 = '1'

All SCCM Clients Matching Version

Build 1702

1234567891011SELECTa.ResourceID AS[ResourceID],a.Name0 AS[Name],a.Client0,a.SMS_Unique_Identifier0,a.Client0,a.Client_Version0FROMv_R_System aWHEREa.Client_Version0 like'5.00.8498.1007'--OR a.Client_Version0 like '5.00.8498.1008'

Build 1610

1234567891011SELECTa.ResourceID AS[ResourceID],a.Name0 AS[Name],a.Client0,a.SMS_Unique_Identifier0,a.Client0,a.Client_Version0FROMv_R_System aWHEREa.Client_Version0 like'5.00.8458.1005'--OR a.Client_Version0 like '5.00.8458.1005'

Build 1606

1234567891011SELECTa.ResourceID AS[ResourceID],a.Name0 AS[Name],a.Client0,a.SMS_Unique_Identifier0,a.Client0,a.Client_Version0FROMv_R_System aWHEREa.Client_Version0 like'5.00.8412.1006'--OR a.Client_Version0 like '5.00.8412.1006'

Build 1511

1234567891011SELECTa.ResourceID AS[ResourceID],a.Name0 AS[Name],a.Client0,a.SMS_Unique_Identifier0,a.Client0,a.Client_Version0FROMv_R_System aWHEREa.Client_Version0 like'5.0.8325.1000'--OR a.Client_Version0 like '5.0.8325.1000'

Collection with all computers without a ConfigMgr client

1234567891011SELECTa.ResourceID,a.ResourceType,a.Name0,a.SMS_Unique_Identifier0,a.Resource_Domain_OR_Workgr0,a.Client0FROMV_R_System asaWHEREa.Client0 isnull

Return machine name, serial, and AD container

1234567891011SELECTa.Name0 AS[Name],b.SerialNumber0 AS[Serial],c.System_Container_Name0FROMv_R_System aLEFTJOINv_GS_PC_BIOS b onb.ResourceID = a.ResourceIDINNERJOINSystem_System_Container_Name_A c onc.ItemKey = a.ResourceIDWHEREb.SerialNumber0 ISNOTNULL

Return computers in a specific domain

123456SELECTa.Name0FROMv_R_System aWHEREa.Resource_Domain_OR_Workgr0 = 'AWESOME'

Collection for all Workstations

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System asSMS_R_SystemWHERESMS_R_System.Operating_System_Name_and0 like'%workstation%'

Collection of all Windows 10 clients

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System asSMS_R_SystemWHERESMS_R_System.Operating_System_Name_and0 like'%workstation% 10.0'

Collection of all Windows 8.1 clients

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System asSMS_R_SystemWHERESMS_R_System.Operating_System_Name_and0 like'%workstation% 6.3'

Collection of all Windows 8 clients

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System asSMS_R_SystemWHERESMS_R_System.Operating_System_Name_and0 like'%workstation% 6.2'

Collection of all Windows 7 clients

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System asSMS_R_SystemWHERESMS_R_System.Operating_System_Name_and0 like'%workstation% 6.1'

Use this query to create collections for your various computer models

123456789101112SELECTDISTINCTa.Name0,b.Manufacturer0,b.Model0FROMv_R_System aINNERJOINv_GS_COMPUTER_SYSTEM bONb.ResourceID = a.ResourceIdWHEREb.Manufacturer0 like'%Hewlett-Packard%'orb.Manufacturer0 like'%VMWare, Inc.%'

Collection of computers ending with odd numbers

123456789101112131415SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemWHERESMS_R_System.Name0 like'%1'orSMS_R_System.Name0 like'%3'orSMS_R_System.Name0 like'%5'orSMS_R_System.Name0 like'%7'orSMS_R_System.Name0 like'%9'

Collection of computers ending with even numbers

123456789101112131415SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemWHERESMS_R_System.Name0 like'%0'orSMS_R_System.Name0 like'%2'orSMS_R_System.Name0 like'%4'orSMS_R_System.Name0 like'%6'orSMS_R_System.Name0 like'%8'

Collection of computers ending with LAB

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemWHERESMS_R_System.Name0 like'%LAB'

Collection of computers beginning with LAB

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemWHERESMS_R_System.Name0 like'LAB%'

Collection of computers without failing hard drive

123456789101112131415161718SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0,V_GS_DISK.Status0FROMv_R_System SMS_R_SystemINNERJOINV_GS_DISKONV_GS_DISK.ResourceId = SMS_R_System.ResourceIdWHEREV_GS_DISK.Status0 != 'Pred Fail'ORDERBYSMS_R_System.Name0 DESC

Collection of computers with failing hard drive

123456789101112131415161718SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0,V_GS_DISK.Status0FROMv_R_System SMS_R_SystemINNERJOINV_GS_DISKONV_GS_DISK.ResourceId = SMS_R_System.ResourceIdWHEREV_GS_DISK.Status0 = 'Pred Fail'ORDERBYSMS_R_System.Name0 DESC

Collection for all Servers

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemWHERESMS_R_System.Operating_System_Name_and0 like'%server%'

Collection of all Windows 2016 Servers

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemWHERESMS_R_System.Operating_System_Name_and0 like'%server% 10.0'

Collection of all Windows 2012 R2 Servers

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemWHERESMS_R_System.Operating_System_Name_and0 like'%server% 6.3'

Collection of all Windows 2012 Servers

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemWHERESMS_R_System.Operating_System_Name_and0 like'%server% 6.2'

Collection of all Windows 2008 R2 Servers

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemWHERESMS_R_System.Operating_System_Name_and0 like'%server% 6.1'

Collection of all Windows 2008 Servers

1234567891011SELECTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemWHERESMS_R_System.Operating_System_Name_and0 like'%server% 6.0'


Collection of all Domain Controllers

12345678910SELECT*FROMv_R_System SMS_R_SystemINNERJOINv_GS_COMPUTER_SYSTEMONv_GS_COMPUTER_SYSTEM.ResourceId = SMS_R_System.ResourceIdWHEREv_GS_COMPUTER_SYSTEM.Roles0 like'%Domain_Controller%'

Query based collection for all Microsoft Exchange Servers

12345678910SELECT*FROMv_R_SystemINNERJOINv_GS_SERVICEONv_GS_SERVICE.ResourceId = v_R_System.ResourceIdWHEREv_GS_SERVICE.Name0 like'%Microsoft Exchange %'

SQL Server Collections

2016

12345678910111213SELECTDISTINCTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.Name0,b.DisplayName0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemINNERJOINV_GS_ADD_REMOVE_PROGRAMS b ONb.ResourceID = SMS_R_System.ResourceIDWHEREb.DisplayName0 like'%Microsoft SQL Server 2016%'

2014

12345678910111213SELECTDISTINCTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.Name0,b.DisplayName0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemINNERJOINV_GS_ADD_REMOVE_PROGRAMS b ONb.ResourceID = SMS_R_System.ResourceIDWHEREb.DisplayName0 like'%Microsoft SQL Server 2014%'

2012

12345678910111213SELECTDISTINCTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.Name0,b.DisplayName0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemINNERJOINV_GS_ADD_REMOVE_PROGRAMS b ONb.ResourceID = SMS_R_System.ResourceIDWHEREb.DisplayName0 like'%Microsoft SQL Server 2012%'

2008

12345678910111213SELECTDISTINCTSMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.Name0,b.DisplayName0,SMS_R_SYSTEM.SMS_Unique_Identifier0,SMS_R_SYSTEM.Resource_Domain_OR_Workgr0,SMS_R_SYSTEM.Client0FROMv_R_System SMS_R_SystemINNERJOINV_GS_ADD_REMOVE_PROGRAMS b ONb.ResourceID = SMS_R_System.ResourceIDWHEREb.DisplayName0 like'%Microsoft SQL Server 2008%'

Query based collection based on IP subnet

12345678910SELECTa.ResourceID,b.Name0 AS[Name],a.IP_Subnets0 AS[Subnet]FROMv_RA_System_IPSubnets aINNERJOINv_R_System b ONb.ResourceID = a.ResourceIDWHEREa.IP_Subnets0 LIKE'10.0.0.0'

Query based collection based on IP range

12345678910SELECTa.ResourceID,b.Name0 AS[Name],a.IP_Addresses0 AS[IP]FROMv_RA_System_IPAddresses aINNERJOINv_R_System b ONb.ResourceID = a.ResourceIDWHEREa.IP_Addresses0 LIKE'10.1.0.1[1-9]'

All Dell Systems

12345678910SELECT*FROMv_R_System aINNERJOINv_GS_COMPUTER_SYSTEM bONb.ResourceID = a.ResourceIdWHEREb.Manufacturer0 like'%Dell%'

All Hewlett-Packard Systems

12345678910SELECT*FROMv_R_System aINNERJOINv_GS_COMPUTER_SYSTEM bONb.ResourceID = a.ResourceIdWHEREb.Manufacturer0 like'%HP%'orb.Manufacturer0 like'%Hewlett-Packard%'

All Lenovo Systems

12345678910SELECT*FROMv_R_System aINNERJOINv_GS_COMPUTER_SYSTEM bONb.ResourceID = a.ResourceIdWHEREb.Manufacturer0 like'%Lenovo%'

All Physical Systems

123456789101112131415SELECTa.ResourceID,a.ResourceType,a.Name0,a.SMS_Unique_Identifier0,a.Resource_Domain_OR_Workgr0,a.Client0FROMv_R_System aINNERJOINv_GS_SYSTEM_ENCLOSURE bONb.ResourceID = a.ResourceIdWHEREb.ChassisTypes0 = '23'orb.ChassisTypes0 = '17'

Pull Distribution Points with Source Distribution Points SQL Query

123456789101112SELECTDISTINCTdbo.v_DistributionPoints.ServerName AS[DP forPull],dbo.v_DistributionPoints.IsPeerDP,dbo.v_DistributionPoints.IsPullDP,dbo.vPullDPFullMap.PullDPNALPath AS[DP List],dbo.v_DistributionPoints.IsPXE,dbo.v_DistributionPoints.DescriptionFROMdbo.vPullDPFullMapINNERJOINdbo.v_DistributionPointsONdbo.vPullDPFullMap.SourceDPNALPath = dbo.v_DistributionPoints.NALPath

Report to list of all users laptops

1234567891011121314151617181920212223SELECTDISTINCTdbo.v_R_System.Name0 AS[Computer Name],dbo.v_R_System.User_Name0 AS[UserName], dbo.v_R_System.User_Domain0 AS[Domain Name],dbo.v_GS_SYSTEM_ENCLOSURE.Manufacturer0 ASManufacturer, dbo.v_GS_COMPUTER_SYSTEM.Model0 ASModel,dbo.v_GS_SYSTEM_ENCLOSURE.SerialNumber0 AS[Serial Number], dbo.v_GS_SYSTEM.SystemRole0 AS[System OS Type],dbo.v_GS_SYSTEM.SystemType0 AS[System Type]FROMdbo.v_GS_SYSTEM_ENCLOSUREINNERJOINdbo.v_R_System ONdbo.v_GS_SYSTEM_ENCLOSURE.ResourceID = dbo.v_R_System.ResourceID INNERJOINdbo.v_GS_SYSTEM ONdbo.v_R_System.ResourceID = dbo.v_GS_SYSTEM.ResourceIDINNERJOINdbo.v_GS_COMPUTER_SYSTEMONdbo.v_GS_SYSTEM.ResourceID = dbo.v_GS_COMPUTER_SYSTEM.ResourceIDWHERE(dbo.v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 = '8') OR(dbo.v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 = '9') OR(dbo.v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 = '10') OR(dbo.v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 = '11') OR(dbo.v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 = '12') OR(dbo.v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 = '14') OR(dbo.v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 = '18') OR(dbo.v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 = '21')

All application list

123456789101112131415161718192021222324SELECT*FROMfn_ListLatestApplicationCIs(1033)SELECTDateCreated,DateLastModified,DisplayName,Manufacturer,SoftwareVersion,CreatedBy,LastModifiedByFROMfn_ListLatestApplicationCIs(1033)GROUPBYDateCreated,DateLastModified,DisplayName,Manufacturer,SoftwareVersion,CreatedBy,LastModifiedByORDERBYDateCreated DESC

All OS with Versions

123456789101112131415SELECTDISTINCTdbo.v_R_System.Netbios_Name0 as[Machine Name],dbo.v_R_System.User_Name0 as[UserName],dbo.v_R_System.AD_Site_Name0 as[AD Site],dbo.v_R_System.User_Domain0 as[Domain],dbo.v_GS_OPERATING_SYSTEM.Caption0 as[OS Name],dbo.v_GS_OPERATING_SYSTEM.CSDVersion0 as[SP Name],dbo.v_R_System.Operating_System_Name_and0 as[OS NT Version],dbo.v_GS_OPERATING_SYSTEM.BuildNumber0 as[Build Number]FROMdbo.v_R_SystemINNERJOINdbo.v_GS_OPERATING_SYSTEMONdbo.v_R_System.ResourceID = dbo.v_GS_OPERATING_SYSTEM.ResourceID

Software Updates Installed using SCCM or Manually

123456789101112131415161718192021SELECTsys.Name0,ui.BulletinID, ui.ArticleID,ui.Title,CASEWHEN(ucs.Status=2 andui.IsDeployed=0 ) then'Required_General'WHEN(ucs.Status=2 andui.IsDeployed=1 ) then'Required_ITICSDeploy'WHEN(UCS.Status=3 andui.IsDeployed=1 ) then'Installed_SCCM'WHEN(UCS.Status=3 andui.IsDeployed=0 ) then'Installed_Manual'WHENUCS.Status=0 then'Unknown'endas'Status',CASEWHENui.severity=10 THEN'Critical'WHENui.severity=8 THEN'Important'WHENui.severity=6 THEN'Moderate'WHENui.severity=2 THEN'Low'WHENui.severity=0 THEN'AddOn'endas'Severity'FROMv_R_System sysINNERJOINv_UpdateComplianceStatus UCS ONsys.ResourceID = ucs.ResourceIDINNERJOINv_UpdateInfo UI ONUCS.CI_ID = UI.CI_IDWHERE-UI.IsDeployed=1 andsys.Netbios_Name0='computer1'ORDERBYStatus

sumber

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *

Situs ini menggunakan Akismet untuk mengurangi spam. Pelajari bagaimana data komentar Anda diproses.