This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to use "GetOneObject" in the API get an ADSPath?

There' s question about the first parameter "searchName" of  GetOneObject.

For reset the Certificate of an AD user by third party web site, I need use  API named "GetCertOfUserInitialize" to get it. The first parameter of "GetCertOfUserInitialize" was using a function  GetADSPath(user) in the sample vbs file, but I can' t get the ADSPath  by GetADSPath via GetOneObject. I’ve tried AD saaccount name, distinguished name ,full name ,even a computer name. All of them couldn’t find the object. How need I to set the first parameter "searchName"? Thanks.



This thread was automatically locked due to age.
Parents
  • You have to initialize the API and the Directory class first.

     

    Set Scripting = WScript.CreateObject("Utimaco.SafeGuard.AdministrationConsole.Scripting.Base")

    Set ScriptingDirectory = Scripting.CreateDirectoryClassInstance()

    result = Scripting.Initialize()

    result = ScriptingDirectory.Initialize()

    An example for GetOneObject and GetCertOfUserInitialize can be found in SGN installation package in file "API sample scripts\Certificates\CertificatesAPI.vbs"

     

    Regards,

    Holger

     

Reply
  • You have to initialize the API and the Directory class first.

     

    Set Scripting = WScript.CreateObject("Utimaco.SafeGuard.AdministrationConsole.Scripting.Base")

    Set ScriptingDirectory = Scripting.CreateDirectoryClassInstance()

    result = Scripting.Initialize()

    result = ScriptingDirectory.Initialize()

    An example for GetOneObject and GetCertOfUserInitialize can be found in SGN installation package in file "API sample scripts\Certificates\CertificatesAPI.vbs"

     

    Regards,

    Holger

     

Children
  • Dear Holger,

            Thanks for your reply!

            I've forgot to add the "result = Scripting.Initialize()" in the function, for I copied it from sample file "API sample scripts\Certificates\CertificatesAPI.vbs".

    Though, I've fix the bug ,I met a new error message "Object not found. -> -5."  from the GetOneObject. What should I do to call the GetOneObject correctly ?

    Thanks a lot.