I have an issue where I am unable to export a PDF to a UNC path. I am using the Workflow "Script SDK" activity to perform the script below. I receive the error when the user is not explicitly assigned to the folder security. If I add a group that the service account is a member of, I receive the access denied error. If I explicitly add the service account to the folder, then I am able to export the PDF to a UNC path.
I opened a laserfiche support ticket and was told to open an answers forum as this may be related to the script.
Here is my script below.
Namespace WorkflowActivity.Scripting.ExportPDF
'''<summary>
'''Provides one or more methods that can be run when the workflow scripting activity is performed.
'''</summary>
Public Class Script1
Inherits RAScriptClass91
'''<summary>
'''This method is run when the activity is performed.
'''</summary>
Protected Overrides Sub Execute()
' Globally used variables
Dim docPath As String = me.BoundEntryInfo.Path
Dim docname as String = ""
Dim docInfo As DocumentInfo = Document.GetDocumentInfo(docPath, me.RAsession)
' Check to see if the parent folder exists
Dim CheckOutputFolderPath As System.IO.DirectoryInfo = New System.IO.DirectoryInfo(TokenReplace("%(ExportPath)"))
If not CheckOutputFolderPath.Exists Then
CheckOutputFolderPath.Create()
End If
docname = TokenReplace("%(DocumentName)") & ".pdf"
' initialize an instance of DocumentExporter
Dim exporter As New DocumentExporter()
exporter.ExportElecDoc(docInfo.GetLatestVersion(), TokenReplace("%(ExportPath)") & docname)
End Sub
End Class
End Namespace