Windows Registry with WMI

PS C:\> Get-WmiObject -Namespace root\default -Class stdregprov –list

PS C:\> Get-WmiObject -Namespace root\default -Class stdregprov -list | select -ExpandProperty methods

PS C:\> $regprov = Get-WmiObject -Namespace root\default -Class stdregprov –list PS C:\> $regprov.methods

Retrieving Internet Explorer Typed URLs:

PS C:\> Invoke-WmiMethod -namespace root\default -class stdregprov -name Enumkey @(2147483649,”software\microsoft\internet explorer”) | select -ExcludeProperty snames

PS C:\> Invoke-WmiMethod -namespace root\default -class stdregprov -name Enumkey @(2147483649,”software\microsoft\internet explorer\typedurls”)

PS C:\> $regprov.GetStringValue(2147483649,”software\microsoft\internet explorer\typedurls”,”url1″) | select -ExpandProperty Svalue

PS C:\> Invoke-WmiMethod -Namespace root\default -Class stdregprov -name getstringvalue @(2147483649, “software\microsoft\internet explorer\typedurls”,”url1″)| select -ExpandProperty svalue

Enable WMI on Target machine then try below command:

PS C:\> Invoke-WmiMethod -Namespace root\default -Class stdregprov -name getstringvalue @(2147483649, “software\microsoft\internet explorer\typedurls”,”url1″) -ComputerName 192.168.222.144 -Credential SECURITY\administrator

PS C:\> $regprov = Get-WmiObject -Namespace root\default -Class stdregprov -list -ComputerName 192.168.222.144 -Credential SECURITY\administrator

PS C:\> $regprov

List WMI installation Directory:

PS C:\> $regprov.GetStringValue(2147483650,”Software\microsoft\WBEM”,”Installation Directory”)

@Saksham Dixit