Accessing Roles and Features from the Remote server.
i tries the following PowerShell script to get the roles and features from the remote server.
Get-WmiObject -Computer "serverName" -query 'select * from Win32_ServerFeature'
but the problem is i could not identify additional details like if the given object from the collection is Feature or role. Any help please?
Finally i found another alternative by using Get-WindowsFeature -ComputerName
where i can filter featuretype
and get separate results for roles and features for remote machines.
For example:
Get-WindowsFeature -ComputerName $ServerName | Where-Object {($_.InstallState -eq “installed”) -and ($_.FeatureType -eq “Role Service”)}