Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

check OS confi

$
0
0

i wanted to knwo operating system configuration whether its 32bit or 64 bit .

this below cmd helped me in getting os of particular system

i.e Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture.

but i want remotly for all server . i tired this below script but it show bit of local system .

there is some loop prblem.can u help me out in tat 

 

foreach ($ComputerName in (Get-Content -Path C:\listofcomputer.txt))

{

 

    $hostname = Get-WmiObject Win32_Computersystem -ComputerName $ComputerName |

    Select-Object -ExpandProperty Name

 

    $OS=Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture

    New-Object -TypeName psObject -Property @{

 

     Hostname = $hostname  

OS =$OS 

}  |Out-File C:\os.txt -Append -Encoding ascii

}


Viewing all articles
Browse latest Browse all 6937

Trending Articles