Solved

WMI query for computers that DO NOT have Remote Desktop Servers installed

Posted on 2014-10-13
6
301 Views
Last Modified: 2014-10-20
Hi,

I need a group policy to run on all servers that DO NOT have Remote Desktop Services installed.

I can easily find which servers that DO have Remote Desktop Services installed as follows:

select * from Win32_OperatingSystem  WHERE ProductType="2"  OR ProductType="3"
select * from Win32_ServerFeature WHERE ID = 18

(http://msdn.microsoft.com/en-us/library/cc280268(v=vs.85).aspx shows that ServerFeature ID 18 = Remote Desktop Services)

the problem I have is that if I change the query to: select * from Win32_ServerFeature WHERE ID != 18 - then this will return true if any other feature is installed and I do not get the desired result.

can anyone help?

many thanks

jack
0
Comment
Question by:jackbenson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40377847
You can add a query that checks for the "TermService" service. All Remote Desktop Services requires it to run. This should filter out all servers with it installed.

SELECT * FROM Win32_Service WHERE Name != 'TermService'
0
 
LVL 1

Author Comment

by:jackbenson
ID: 40378432
Joshua

thanks for your reply.
 
on the server running RDS this query returned all the services that were not Terminal Services that was installed on the machine and therefore the Group Policy was applied to the machine

on the server that was not running RDS - but had the ability to remote desktop to it enabled - it also returned true.

jack
0
 
LVL 16

Accepted Solution

by:
Joshua Grantom earned 500 total points
ID: 40379716
I think your best bet would be to add all of the RDS servers into a security group and deny them read access to the group policy you do not want applied
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 1

Author Comment

by:jackbenson
ID: 40391482
thanks - I was worried that I would have to do that - means I need to remember to add servers to the group in future

thanks for your help

jack
0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40391915
No problem Jack, sorry there wasn't a WMI answer ;/
0
 
LVL 1

Author Comment

by:jackbenson
ID: 40391922
thanks for trying
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Change Exchange 2010 Namespace 6 68
Do not see remote app manager 2 50
Run Server 2012 on PowerEdge 2950 13 78
Compatibility view list registry key 1 41
My GPO's made for 2008 R2 servers were not allowing me to RDP into a new 2012 server by default.  That’s why I tried to allow RDP via Powershell, because I could log into a remote shell without further configuration. Below I will describe how I wen…
Resolve DNS query failed errors for Exchange
In this Micro Tutorial viewers will learn how to restore single file or folder from Bare Metal backup image of their system. Tutorial shows how to restore files and folders from system backup. Often it is not needed to restore entire system when onl…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question