Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnRegister-ObjectIdentifier function #224

Open
madburg opened this issue Oct 28, 2024 · 1 comment
Open

UnRegister-ObjectIdentifier function #224

madburg opened this issue Oct 28, 2024 · 1 comment
Labels
bug Bug. An issue exist in our code.
Milestone

Comments

@madburg
Copy link

madburg commented Oct 28, 2024

PS C:\Windows\system32> get-help Unregister-ObjectIdentifier -Examples

NAME
Unregister-ObjectIdentifier

SYNOPSIS
Unregisters object identifier (OID) information from local computer, Active Directory or both sources.

--------------------------  Example 1  --------------------------

PS C:\> Unregister-ObjectIdentifier -Value "Remote Desktop Authentication" -UseActiveDirectory

Unregisters a custom OID that was previously registered in Active Directory.

Could not get UnRegister-ObjectIdentifier to work; unclear how to actually switch "from local computer, Active Directory or both sources." as stated?

Steps taken:

  1. Create OID in AD using Register-ObjectIdentifier function:

Register-ObjectIdentifier -FriendlyName "Contoso Pharmaceuticals smart card policy" -Value "1.3.6.1.4.1.50095.1.1.1.1.0" -OidGroup IssuancePolicy -CPSLocation "http://www.contoso.com/cps/documents/scpolicy.pdf" -UseActiveDirectory

  1. Now try and delete this OID using UnRegister-ObjectIdentifier function:
    From example it seems -Value argument should take the -FriendlyName argument we used to create the OID:

PS C:\Windows\system32> Unregister-ObjectIdentifier -Value "Contoso Pharmaceuticals smart card policy" -UseActiveDirectory

Unregister-ObjectIdentifier : Cannot process argument transformation on parameter 'Value'. Cannot convert the "Contoso
Pharmaceuticals smart card policy" value of type "System.String" to type "SysadminsLV.PKI.Cryptography.Oid2".
At line:1 char:36

  • ... Identifier -Value "Contoso Pharmaceuticals smart card policy" -UseAct ...
  •                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Unregister-ObjectIdentifier], ParameterBindingArgumentTransformationEx
      ception
    • FullyQualifiedErrorId : ParameterArgumentTransformationError,Unregister-ObjectIdentifier

  1. For troubleshoot tried using the OID value instead of friendlyname for -Value argument (tried with double quotes, single quotes and no quotes, always same result):

PS C:\Windows\system32> Unregister-ObjectIdentifier -Value 1.3.6.1.4.1.50095.1.1.1.1.0 -UseActiveDirectory

Unregister-ObjectIdentifier : Cannot process argument transformation on parameter 'Value'. Cannot convert the
"1.3.6.1.4.1.50095.1.1.1.1.0" value of type "System.String" to type "SysadminsLV.PKI.Cryptography.Oid2".
At line:1 char:36

  • ... nregister-ObjectIdentifier -Value 1.3.6.1.4.1.50095.1.1.1.1.0 -UseAct ...
  •                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Unregister-ObjectIdentifier], ParameterBindingArgumentTransformationEx
      ception
    • FullyQualifiedErrorId : ParameterArgumentTransformationError,Unregister-ObjectIdentifier

@Crypt32 Crypt32 added the bug Bug. An issue exist in our code. label Oct 28, 2024
@Crypt32 Crypt32 added this to the v4.3 milestone Oct 28, 2024
@Crypt32
Copy link
Collaborator

Crypt32 commented Oct 28, 2024

Sounds like a bug. Will look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug. An issue exist in our code.
Projects
None yet
Development

No branches or pull requests

2 participants