Afternoon. I have a problem I was hoping some folks could help sort out. We are currently running a web app on iis7 that has a simple function, to encrypt a file (uses gpg.exe). Simple command line process, works fine with a local user on the server (2008R2). We are trying to get rid of all local users and want to switch everyone up to a domain user, but when we add in the domain the process fails (we change the login to a new domain user). The user has the appropriate rights, and can manually run the .exe when logged into the server as well as can run the same command via a scheduled task (acting "as" that user).
Fairly simple code:
'// Create startinfo object
Dim pInfo As New Diagnostics.ProcessStartInfo(cmdName, cmdOptions)
pInfo.WorkingDirectory = workingDirectory
pInfo.CreateNoWindow = True
pInfo.UseShellExecute = False
'// Redirect everything:
'// stdin to send the passphrase, stdout to get encrypted message, stderr in case of errors...
pInfo.RedirectStandardInput = True
pInfo.RedirectStandardOutput = True
pInfo.RedirectStandardError = True
'If we have credentials, use them
pInfo.UserName = login
pInfo.Domain = domain
If pwd <> "" Then
pInfo.WindowStyle = ProcessWindowStyle.Hidden
Dim key As New System.Security.SecureString()
For Each c As Char In pwd.ToCharArray()
key.AppendChar(c)
Next
pInfo.Password = key
End If
Essentially if I leave domain as "" then everything works. If I put in our domain, it fails. I have even tried creating the user locally and "Elevating" them to the domain...still fails.
Error is:
Faulting application gpg.exe, version 0.0.0.0, time stamp 0x47ea8c2e, faulting module kernel32.dll, version 6.0.6002.18881, time stamp 0x51da3e00, exception code 0xc0000142, fault offset 0x0006f52f, process id 0xc4c, application start time 0x01cea29518295dc5.
What I have tried:
Impersonation. Tried...failed. Same essential error.
USer rights. Modified to the point of not knowing where we were.
New user.
I suspect the issue is in user rights of some sort, OR in windows station and desktop privileges, but I cannot figure out why it would work with a local user and not work with a domain user.
We have another need for a very similar process to run via a specified user as well, so solving this would be helpful as we could expand out our coding and clean up a lot of the code, etc. It is also receiving a similar error with user31.dll when we try to execute the code this way. Again it works via scheduled task and command line, and we have been assured that no external output occurs when suppressed (via a command line switch).
Fairly simple code:
'// Create startinfo object
Dim pInfo As New Diagnostics.ProcessStartInfo(cmdName, cmdOptions)
pInfo.WorkingDirectory = workingDirectory
pInfo.CreateNoWindow = True
pInfo.UseShellExecute = False
'// Redirect everything:
'// stdin to send the passphrase, stdout to get encrypted message, stderr in case of errors...
pInfo.RedirectStandardInput = True
pInfo.RedirectStandardOutput = True
pInfo.RedirectStandardError = True
'If we have credentials, use them
pInfo.UserName = login
pInfo.Domain = domain
If pwd <> "" Then
pInfo.WindowStyle = ProcessWindowStyle.Hidden
Dim key As New System.Security.SecureString()
For Each c As Char In pwd.ToCharArray()
key.AppendChar(c)
Next
pInfo.Password = key
End If
Essentially if I leave domain as "" then everything works. If I put in our domain, it fails. I have even tried creating the user locally and "Elevating" them to the domain...still fails.
Error is:
Faulting application gpg.exe, version 0.0.0.0, time stamp 0x47ea8c2e, faulting module kernel32.dll, version 6.0.6002.18881, time stamp 0x51da3e00, exception code 0xc0000142, fault offset 0x0006f52f, process id 0xc4c, application start time 0x01cea29518295dc5.
What I have tried:
Impersonation. Tried...failed. Same essential error.
USer rights. Modified to the point of not knowing where we were.
New user.
I suspect the issue is in user rights of some sort, OR in windows station and desktop privileges, but I cannot figure out why it would work with a local user and not work with a domain user.
We have another need for a very similar process to run via a specified user as well, so solving this would be helpful as we could expand out our coding and clean up a lot of the code, etc. It is also receiving a similar error with user31.dll when we try to execute the code this way. Again it works via scheduled task and command line, and we have been assured that no external output occurs when suppressed (via a command line switch).