Why not just use Get-ItemPropertyValue?
I guess I’m missing something.
From: ntpowe...@googlegroups.com <ntpowe...@googlegroups.com>
On Behalf Of Kurt Buff, GSEC/GCIH/PCIP
Sent: Friday, February 12, 2021 2:05 PM
To: ntpowe...@googlegroups.com
Subject: [ntpowershell] Re: Extra Registry Settings in a GPO
Figured it out - it wanted just the key, and not the full specification of the parameter.
get-gpregistryvalue -server dc0 -name "CorpLock -key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters"
KeyPath : SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters
FullKeyPath : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters
Hive : LocalMachine
PolicyState : Set
Value : -1
Type : DWord
ValueName : DisabledComponents
HasValue : True
On Fri, Feb 12, 2021 at 11:30 AM Kurt Buff, GSEC/GCIH/PCIP <kurt...@gmail.com> wrote:
All,
We have a GPO called CorpLock, and among other things it has an extra registry setting that disables IPv6:
I intended to get the setting before trying to delete it (and replace it with a preference for IPv4, because that's what I can get away with), and I'm glad I did, because that's getting an error. I am using my DA account, and an elevated PowerShell session.
Am I missing something, or is there a better way to do this?
get-gpregistryvalue -server dc0 -name "CorpLock" -key "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents"
get-gpregistryvalue : The following Group Policy registry setting was not found:
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents".
Parameter name: keyPath
At line:1 char:1
+ get-gpregistryvalue -server dc0 -name "CorpLock" -key "HK ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Group...tryValueCommand:GetGPRegistryValueCommand) [Get-GPRegistryValue], ArgumentException
+ FullyQualifiedErrorId : UnableToRetrievePolicyRegistryItem,Microsoft.GroupPolicy.Commands.GetGPRegistryValueCommand
Thanks,
Kurt
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ntpowershell...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ntpowershell/CADy1Ce4_dEorJDUTwiA00rJxvGDSxi-tOooVnaJx354hiVnL3A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/6d2fe938115a400faa8361a91b316339%40smithcons.com.
First
get-gpregistryvalue -server dc0 -name "CorpLock" -key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" -valuename DisabledComponents
Second, now I see what I missed… you were only interested in what the GPO says, not what the actual registry says.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Group...tryValueCommand:GetGPRegistryValueCommand) [Get-GPRegistryValue], ArgumentException
+ FullyQualifiedErrorId : UnableToRetrievePolicyRegistryItem,Microsoft.GroupPolicy.Commands.GetGPRegistryValueCommand
Thanks,
Kurt
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ntpowershell...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/CADy1Ce4_dEorJDUTwiA00rJxvGDSxi-tOooVnaJx354hiVnL3A%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ntpowershell...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/6d2fe938115a400faa8361a91b316339%40smithcons.com.
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ntpowershell...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/CADy1Ce6Wx%3D4DYxZ9W6WG2JLHN%2ByutOPjm_5CxFCC1qTzX_SFog%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/e34882634f164495a38425fbec772851%40smithcons.com.
No, I don’t think it would convert it. I think you have to recreate it.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Group...tryValueCommand:GetGPRegistryValueCommand) [Get-GPRegistryValue], ArgumentException
+ FullyQualifiedErrorId : UnableToRetrievePolicyRegistryItem,Microsoft.GroupPolicy.Commands.GetGPRegistryValueCommand
Thanks,
Kurt
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ntpowershell...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/CADy1Ce4_dEorJDUTwiA00rJxvGDSxi-tOooVnaJx354hiVnL3A%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ntpowershell...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/6d2fe938115a400faa8361a91b316339%40smithcons.com.
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ntpowershell...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/CADy1Ce6Wx%3D4DYxZ9W6WG2JLHN%2ByutOPjm_5CxFCC1qTzX_SFog%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ntpowershell...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/e34882634f164495a38425fbec772851%40smithcons.com.
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ntpowershell...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/CADy1Ce7Vh%3DNCFO_DmakAZu0ZKYyFeh8Ar2s381K-auFg3L7y_Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/CADy1Ce7Vh%3DNCFO_DmakAZu0ZKYyFeh8Ar2s381K-auFg3L7y_Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/243fca28-5ac8-50de-149c-164b90e36979%40univie.ac.at.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/243fca28-5ac8-50de-149c-164b90e36979%40univie.ac.at.