Created
April 15, 2021 15:17
-
-
Save emnavarro02/1d674853805affdc513571f25d62ffa7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--- | |
# http://fkazi.blogspot.com/2013/04/creating-custom-active-directory_27.html | |
$Prefix="1.2.840.113556.1.8000.2554" | |
$GUID=[System.Guid]::NewGuid().ToString() | |
$Parts=@() | |
$Parts+=[UInt64]::Parse($guid.SubString(0,4),"AllowHexSpecifier") | |
$Parts+=[UInt64]::Parse($guid.SubString(4,4),"AllowHexSpecifier") | |
$Parts+=[UInt64]::Parse($guid.SubString(9,4),"AllowHexSpecifier") | |
$Parts+=[UInt64]::Parse($guid.SubString(14,4),"AllowHexSpecifier") | |
$Parts+=[UInt64]::Parse($guid.SubString(19,4),"AllowHexSpecifier") | |
$Parts+=[UInt64]::Parse($guid.SubString(24,6),"AllowHexSpecifier") | |
$Parts+=[UInt64]::Parse($guid.SubString(30,6),"AllowHexSpecifier") | |
$OID=[String]::Format("{0}.{1}.{2}.{3}.{4}.{5}.{6}.{7}",$prefix,$Parts[0],$Parts[1],$Parts[2],$Parts[3],$Parts[4],$Parts[5],$Parts[6]) | |
$oid | |
#--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment