Speed
Speed

Reputation: 417

Get-WmiObject Win32_ServerFeature Access Remote Server Roles and features

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?

Upvotes: 1

Views: 2122

Answers (1)

Speed
Speed

Reputation: 417

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”)}

Upvotes: 1

Related Questions