2013-04-23 41 views
0

我試圖找到一個64位版本的「win32_computersystem」Get-WmiObject及其屬性的等價物?我一直在尋找,但無法找到它。任何建議,將不勝感激..尋找64位版本的32位等效WmiObject

function GetStatus ($system = $_.name) { 
     $userlogon = $null 
     $userlogon= gwmi -Class win32_computersystem -ComputerName $system | select -ExpandProperty username -ErrorAction Stop 
     } 

感謝,

米奇

+0

你會期待「win32_computersystem」的64位版本是什麼?前綴'Win32_'大多是歷史性的,並不意味着它在64位進程中不可用(例如比較32位和64位PowerShell實例中的代碼結果)。 – Richard 2013-04-23 08:28:02

回答

1

http://msdn.microsoft.com/en-us/library/aa390789.aspx

Generally, provider writers do not include both 32-bit and 64-bit versions of a 
provider in the same operating system. If no 64-bit provider exists, a 32-bit provider 
can continue to run through the facilities of WOW64 

然後你就可以在x64操作系統使用win32_computersystem

Here你可以找到一個有用的腳本從x32 OS遠程檢索x64操作系統的原始(不是wow64)註冊表值。