Guest User!

You are not Sophos Staff.

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

Problem invoke SGN API.

I had build a Web site on MG server , similar to SGN's web_helpdesk.

And  running a  VB script    in the webservice, then the vb script  invoked the SGN API.

When  exec  function  Scripting.AuthenticateOfficer in the script, it return error: “A database exception occurred”

But it is OK when I run vb script in cmd.

VB Script 

...
msoName = "MSO"
sgnPassword = "******"

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

result = Scripting.Initialize()
ret = Scripting.GetLastError(ErrorText)
wscript.echo("Init Scripting: " & ErrorText)

result = Scripting.AuthenticateOfficer(msoName, sgnPassword, "")
ret = Scripting.GetLastError(ErrorText)
wscript.echo("AuthenticateOfficer: " + ErrorText)

result = ScriptingDirectory.Initialize()
ret = Scripting.GetLastError(ErrorText)
wscript.echo("Init ScriptingDirectory: " + ErrorText)

...
:28583


This thread was automatically locked due to age.
Parents
  • I can try to help you with this

    Your problem is that the IIS instance is running as a limited user without any domain rights to log onto the database similar to using a local account vs a domain service account to run a service that needs domain access rights for some reason.

    This might be a multi-stage issue to get past for you but the first thing I would do is set your IIS instance to run as a domain user and give that domain user access rights to log on and use the database with both read and write privileges. See if that helps first. Remember what you can do with a script or program is always limited by the user context by which it's running.

    This was the first problem I encountered with using the API. FYI you may not want to do this project in VBScript, you'll have some serious limitation with your scripting environment and if you integrate a web form into your functionality, good luck getting multi-user issues worked out. You may want to have a .NET developer load the required DLL into their GAC, run a debug and get the public functions out of it and integraite it into a asp.net page with some C# or VB.NET code behind.

    You'll have to extract the management center MSI with a /A switching to it's own folder to get the base scripting MSI by itself to give to an experienced .NET developer if I remember correctly. Honestly .NET is the way to go and it's fully compatible, I use it where I work to create SGN API integrated web forms with active directory authentication and group membership look-ups. Runs with ASP.NET and C# code behind.
    :28765
Reply
  • I can try to help you with this

    Your problem is that the IIS instance is running as a limited user without any domain rights to log onto the database similar to using a local account vs a domain service account to run a service that needs domain access rights for some reason.

    This might be a multi-stage issue to get past for you but the first thing I would do is set your IIS instance to run as a domain user and give that domain user access rights to log on and use the database with both read and write privileges. See if that helps first. Remember what you can do with a script or program is always limited by the user context by which it's running.

    This was the first problem I encountered with using the API. FYI you may not want to do this project in VBScript, you'll have some serious limitation with your scripting environment and if you integrate a web form into your functionality, good luck getting multi-user issues worked out. You may want to have a .NET developer load the required DLL into their GAC, run a debug and get the public functions out of it and integraite it into a asp.net page with some C# or VB.NET code behind.

    You'll have to extract the management center MSI with a /A switching to it's own folder to get the base scripting MSI by itself to give to an experienced .NET developer if I remember correctly. Honestly .NET is the way to go and it's fully compatible, I use it where I work to create SGN API integrated web forms with active directory authentication and group membership look-ups. Runs with ASP.NET and C# code behind.
    :28765
Children
No Data