[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Problem with Impersonate on a web service

Posted on 2009-06-30
6
Medium Priority
?
366 Views
Last Modified: 2012-05-07
I have a working web service.  When data is received I would like to run an external program against this data.  I have setup impersonation to use a known-working username and password, but the program does not run.

Thanks for any ideas.
If impersonateValidUser("myuser", "WEST", "mypassword") Then
    '
    Dim proc As New Process
    proc.StartInfo.Password = New System.Security.SecureString()
    For Each c As Char In "mypassword"
        proc.StartInfo.Password.AppendChar(c)
    Next
    proc.StartInfo.UseShellExecute = False
    proc.StartInfo.Arguments = arg1 & " " & arg2
    proc.StartInfo.FileName = "C:\Program Files\DoMerge\DoMerge.exe"
 
    proc.Start()
 
    undoImpersonation()
 
End If

Open in new window

0
Comment
Question by:Tom Sage
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 15

Accepted Solution

by:
jinal earned 1500 total points
ID: 24751031
did you check that it is going inside if condition.

If impersonateValidUser("myuser", "WEST", "mypassword") Then
    '
    Dim proc As New Process
    proc.StartInfo.Password = New System.Security.SecureString()
    For Each c As Char In "mypassword"
        proc.StartInfo.Password.AppendChar(c)
    Next
    proc.StartInfo.UseShellExecute = False
    proc.StartInfo.Arguments = arg1 & " " & arg2
    proc.StartInfo.FileName = "C:\Program Files\DoMerge\DoMerge.exe"
 
    proc.Start()
    proc.WaitForExit()
    undoImpersonation()
 
End If

I think you are missing to provide UserName and Domain in proc.StartInfo .
0
 
LVL 15

Expert Comment

by:jinal
ID: 24751037
Also try without giving password, username and domain if your imperosnate user has rights to create process.
0
 

Author Comment

by:Tom Sage
ID: 24751066
Hi jinal,

Yes, I put a call to an email program in the IF statement, so I know I am using valid credentials.

Thanks
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Tom Sage
ID: 24751112
jinal,

I ran the process explorer program, and I can see that the program did start, but it did not run to completion.  It seems hung for some reason.

Thanks
0
 
LVL 15

Expert Comment

by:jinal
ID: 24751546
is it required any input for process?
0
 

Author Closing Comment

by:Tom Sage
ID: 31598528
Thank you for the help.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question