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

Error inserting into ADSACCOUNT

Hello,

As part of one of the process steps we're creating entry in ADSACCOUNT table with parameters obtained from a script.

Once the process reaches this step it is failing with the error below

2016-07-14 13:35:10 -05:00 - VI.JobService.JobComponents.ScriptComponent - 6287db56-737e-4846-88f2-fd8e40cbc226: Errors occured [810222] Error executing script <SCRIPTNAME> [810008] Could not save object Active Directory user accounts (, [USER]). [810019] Could not create single object for table Domain. [810029] Object of type Domains does not exist in database or you do not have the relevant viewing permissions. at StdioProcessor.StdioProcessor._Execute(Job job) at VI.JobService.JobComponents.ScriptComponent.Activate(String task) at VI.JobService.JobComponents.ScriptComponent._TaskScriptExec() at VI.DB.Scripting.ScriptInstance.Eval(String key, Object[] parameters)

 

Any help will be greatly appreciated

 

Thanks in advance

  • Have you verified the script on its own? You can try this by testing the script outside the process and see if it returns the values as expected. 

    My best guess at the moment is that you are trying to create an object of type "Domains" and D1IM is complaining about, i.e. it can't find a table by the name "Domains". I can't remember the name of the tables, but maybe what you are looking for is ADSDomain or Domain (not Domains) ? 

    HTH

  • aravagg,

    Thanks for the response. WE are not trying to create any object of type "Domains". Below is the script. When we test the script independently outside of the process, it is failing with the error

    [810077] Active Directory user accounts: Name is a compulsory field and needs to be filled.

     

    Not sure what it is complaining about

     

    Public Function XXX_SA_WriteToADSACCOUNT(ByVal ProdID As String,ByVal STGID As String,ByVal QAID As String,ByVal DEVID As String,ByVal DisName As String,ByVal AccExpires As Date, ByVal PrimOw As String, ByVal SecOw As String, ByVal AddlOw As String, ByVal Desc As String, ByVal CnUID As String) As Boolean
     
     'Create  Variables
     Dim PDisName As String = String.Concat(ProdID,DisName)
     Dim SDisName As String = String.Concat(STGID,DisName)
     Dim QDisName As String = String.Concat(QAID,DisName)
     Dim DDisName As String = String.Concat(DEVID,DisName)
     Dim AdOwner As String
     If (String.Compare($XXX_SA_AdditionalOwner$,"null") <> 0) Then
     AdOwner  = String.Concat("Owner: ",PrimOw,",",SecOw,",",AddlOw)
     Else
     AdOwner = String.Concat("Owner: ",PrimOw,",",SecOw)
     End If
     
     If  (String.Compare(ProdID, "null") <> 0)Then
      Dim obj As ISingleDbObject = Connection.CreateSingle("ADSAccount")
       obj.PutValue("UID_ADSCONTAINER", CnUID)
       obj.PutValue("CN", ProdID)
        obj.PutValue("ACCOUNTEXPIRES", AccExpires)
       obj.PutValue("DISTINGUISHEDNAME", PDisName)
       obj.PutValue("OBJECTCLASS", "USER")
       obj.PutValue("SAMACCOUNTNAME", ProdID)
       obj.PutValue("GIVENNAME", ProdID)
       obj.PutValue("INFO", Desc)
       obj.PutValue("DESCRIPTION", AdOwner)
       obj.Save() 
     End If

     If (String.Compare(STGID, "null") <> 0) Then
      Dim obj As ISingleDbObject = Connection.CreateSingle("ADSAccount")
       obj.PutValue("UID_ADSCONTAINER", CnUID)
       obj.PutValue("CN", STGID)
        obj.PutValue("ACCOUNTEXPIRES", AccExpires)
       obj.PutValue("DISTINGUISHEDNAME", SDisName)
       obj.PutValue("OBJECTCLASS", "USER")
       obj.PutValue("SAMACCOUNTNAME", STGID)
       obj.PutValue("GIVENNAME", STGID)
       obj.PutValue("INFO", Desc)
       obj.PutValue("DESCRIPTION", AdOwner)
       obj.Save()
     End If
     If (String.Compare(QAID, "null") <> 0) Then
      Dim obj As ISingleDbObject = Connection.CreateSingle("ADSAccount")
       obj.PutValue("UID_ADSCONTAINER", CnUID)
       obj.PutValue("CN", QAID)
        obj.PutValue("ACCOUNTEXPIRES", AccExpires)
       obj.PutValue("DISTINGUISHEDNAME", QDisName)
       obj.PutValue("OBJECTCLASS", "USER")
       obj.PutValue("SAMACCOUNTNAME", QAID)
       obj.PutValue("GIVENNAME", QAID)
       obj.PutValue("INFO", Desc)
       obj.PutValue("DESCRIPTION", AdOwner)
       obj.Save()
     End If
     If (String.Compare(DEVID, "null") <> 0) Then
      Dim obj As ISingleDbObject = Connection.CreateSingle("ADSAccount")
       obj.PutValue("UID_ADSCONTAINER", CnUID)
       obj.PutValue("CN", DEVID)
        obj.PutValue("ACCOUNTEXPIRES", AccExpires)
       obj.PutValue("DISTINGUISHEDNAME", DDisName)
       obj.PutValue("OBJECTCLASS", "USER")
       obj.PutValue("SAMACCOUNTNAME", DEVID)
       obj.PutValue("GIVENNAME", DEVID)
       obj.PutValue("INFO", Desc)
       obj.PutValue("DESCRIPTION", AdOwner)
       obj.Save()
     End If

     'Return a Success Value showing the script executed
     XXX_SA_WriteToADSACCOUNT = True
    End Function

     

  • Please ignore my earlier post. The script by itself is working fine. But we are still seeing the error below in the process step

    2016-07-18 08:16:26 -05:00 - VI.JobService.JobComponents.ScriptComponent - 3f6077f9-9337-4a17-9182-2215c73d6c3d: Errors occured
        Optimizing by using the existing connection.
        [810222] Error executing script 'XXX_SA_WriteToADSACCOUNT'.
        [810008] Could not save object Active Directory user accounts (DOMAIN.COMPANY.COM/08_Corporate_Apps/abcd [USER]).
        [810019] Could not create single object for table Domain.
        [810029] Object of type Domains does not exist in database or you do not have the relevant viewing permissions.
           at StdioProcessor.StdioProcessor._Execute(Job job)
           at VI.JobService.JobComponents.ScriptComponent.Activate(String task)
           at VI.JobService.JobComponents.ScriptComponent._TaskScriptExec()
           at VI.DB.Scripting.ScriptInstance.Eval(String key, Object[] parameters)
           ---- Start of Inner Exception ----
           at DynScripts.Scripts_52CF2F8962C2473BBD27ACF365268D5F.XXX_SA_WriteToADSACCOUNT(String ProdID, String STGID, String QAID, String DEVID, String DisName, DateTime AccExpires, String PrimOw, String SecOw, String AddlOw, String Desc, String CnUID)
           at VI.DB.Implementation.SingleDbObject.Save()