2013-04-23 82 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)注册表值。