Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Terminal Services

$
0
0

So, The below script i wrote real quick to run a list of servers and find out if they are terminal servers or not. All Windows 2003 servers are reporting correctly. However the windows 2008 has a couple issues. First not for sure what to query to get if it is a terminal server or not. Second the script is not reporting ANY of the results back from there just getting the bellow error for them. Any help would be great! thanks.

Get-wmiobject : Invalid class "Win32_TerminalServiceSetting"

$servers = get-qadcomputer -searchroot "test.com/member servers/site"
$list = $servers.name
$version = $servers.osname
$A = "Windows Server 2003"
$B = "Windows Server 2008 R2 Standard"
$C = "Windows Server® 2008 Standard"

foreach ($server in $list){

            IF ($version -eq $A){ 
                    Get-wmiobject -computername "$server" -class Win32_TerminalServiceSetting | select servername, licensingtype
                }
            ELSEIF ($version = $B -r $C) {
                    get-wmiobject -computername $server -class Win32_TerminalService | select systemname
        }
    }


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>