Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Using GWMI

$
0
0

Hi,

I am using the following to retrieve the version of windows from multiple servers, it works fine, but how can I modify it so that it also lists the server name ? The server names are in the servers.txt file

gwmi win32_operatingsystem -comp(gc d:\servers.txt) | select Caption, ServicePackmajorVersion | ft | auto

So the current ouput is:

Caption                                                                            ServicePackMajorVersion

Microsoft Windows Server 2003, Standard Edition           2

And I need

Computername                        Caption                                                                            ServicePackMajorVersion

SQL01                                       Microsoft Windows Server 2003, Standard Edition           2

 

 


Viewing all articles
Browse latest Browse all 10624

Trending Articles