SQL Query to get all SCCM servers with their roles

Most of the time system administrator struggle to find all the SCCM servers with their roles. I have created one sql query to get the details servers with the roles. Query is below SELECTsrs.ServerName,srs.SiteCode,vs.SiteName,vst.AD_Site_Name0 as ADSite,vs.ReportingSiteCode as Parent,vs.Installdir,MAX(CASE srs.rolename WHEN 'SMS Site System' THEN 'Yes' Else ' ' END) as SiteSys,MAX(CASE srs.rolename WHEN 'SMS Component … Continue reading SQL Query to get all SCCM servers with their roles