On a few systems I have GetDwordValue return duplicate values (.uvalue) The commands are
$reg=Get-WmiObject -List -Namespace root\default -ComputerName $ip.ipaddress | Where-Object {$_.Name -eq "StdRegProv"}
$reg.GetDwordValue($HKLM,"System\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server","enabled").uvalue
It returns the values
1
1
If I run this without the .uvalue it gives me this output below and I know were it gets the 1 1 duplicates, just not why.
$reg.GetDwordValue($HKLM,"System\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server","enabled")
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 2
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ReturnValue : 0
uValue : 1
PSComputerName :
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 2
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ReturnValue : 0
uValue : 1
PSComputerName :
This happens to about 3 of our servers and cannot figure out why or how to return one value only.
There is no information where the
$ip
object comes from… If its type is an array (or any kind of a list, e.g.Object[]
), then the code snippet contradict neither theGet-WmiObject
cmdlet syntax (-ComputerName <String[]>
), nor theGetDWORDValue
method of theStdRegProv
class.Proof:
Output: