2 Replies Latest reply on Mar 20, 2017 4:40 PM by Gene Slaughter

    How to parse RegistryKey string?

    Gene Slaughter
      regkey01 := raw "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Distinguished-Name"; // AD OU

      regqry01 := discovery.registryKey(host, regkey01);

       

      Result from above RegistryKey query:  CN=MACHINENAME,OU=ou4,OU=ou3,OU=ou2,OU=ou1,DC=dc1,DC=dc2,DC=dc3,DC=dc4

       

      Option1 preferred result: OU=ou4,OU=ou3,OU=ou2,OU=ou1,DC=dc1,DC=dc2,DC=dc3,DC=dc4 (remove up to and including first comma)

      Option2 preferred result:  dc1.dc2.dc3.dc4/ou1/ou2/ou3/ou4 (remove up to and including first comma and complete redesign of output)

       

      Any idea how to make the Result above look like Option1 or Option2? 

      I have tried multiple attempts in Kodos and Regex Coach from what I can find from Web searches but, with no success