Ying Li at myITforum.com

PowerShell & System Center

Query to identify non Domain Controller and non SMS Primary Servers

Here is a SMS query to create a collection including all the window server 2003 and window 2000 SP4 servers but exclude domain controllers and SMS primary servers. It also excludes servers in certain subnet. It excludes 64 bit servers as well.

 

select SMS_R_System.ResourceID,SMS_R_System.ResourceType,SMS_R_System.Name,SMS_R_System.SMSUniqueIdentifier,SMS_R_System.ResourceDomainORWorkgroup,SMS_R_System.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_NETWORK_ADAPTER_CONFIGURATION on SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.ResourceID = SMS_R_System.ResourceId where SMS_R_System.OperatingSystemNameandVersion like "%Server 5.0%" and SMS_G_System_OPERATING_SYSTEM.CSDVersion >= "Service Pack 4" and SMS_R_System.IPSubnets != "10.1.1.0" and SMS_G_System_COMPUTER_SYSTEM.DomainRole < 4 and SMS_R_System.ResourceDomainORWorkgroup = "ADDOMAIN" and SMS_R_System.ResourceId not in (select SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID from SMS_G_System_ADD_REMOVE_PROGRAMS where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "Microsoft Systems Management Server 2003 Primary Site") or SMS_R_System.OperatingSystemNameandVersion like "%Server 5.2%" and SMS_R_System.IPSubnets != "10.1.1.0" and SMS_G_System_COMPUTER_SYSTEM.SystemType != "x64-based PC"  and SMS_G_System_COMPUTER_SYSTEM.DomainRole < 4 and SMS_R_System.ResourceDomainORWorkgroup = "ADDOMAIN" and SMS_R_System.ResourceId not in (select SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID from SMS_G_System_ADD_REMOVE_PROGRAMS where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "Microsoft Systems Management Server 2003 Primary Site")

 

Posted: Jan 23 2007, 10:55 AM by yli628 | with no comments
Filed under:

Comments

No Comments