Click here to Skip to main content
15,896,201 members
Home / Discussions / C#
   

C#

 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl6-May-13 3:40
MichCl6-May-13 3:40 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen6-May-13 7:52
professionalEddy Vluggen6-May-13 7:52 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl6-May-13 9:19
MichCl6-May-13 9:19 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl7-May-13 2:09
MichCl7-May-13 2:09 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen7-May-13 3:16
professionalEddy Vluggen7-May-13 3:16 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl7-May-13 3:55
MichCl7-May-13 3:55 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen7-May-13 9:04
professionalEddy Vluggen7-May-13 9:04 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl3-May-13 8:49
MichCl3-May-13 8:49 
QuestionHow to view the images from folder one by one Pin
9,937,550 members2-May-13 20:04
professional9,937,550 members2-May-13 20:04 
AnswerRe: How to view the images from folder one by one Pin
OriginalGriff2-May-13 21:34
mveOriginalGriff2-May-13 21:34 
GeneralRe: How to view the images from folder one by one Pin
9,937,550 members3-May-13 2:13
professional9,937,550 members3-May-13 2:13 
AnswerRe: How to view the images from folder one by one Pin
abdussalam1433-May-13 3:15
professionalabdussalam1433-May-13 3:15 
QuestionCan't run SC remotely to config service Pin
SledgeHammer012-May-13 13:43
SledgeHammer012-May-13 13:43 
AnswerRe: Can't run SC remotely to config service Pin
Dave Kreskowiak2-May-13 15:42
mveDave Kreskowiak2-May-13 15:42 
GeneralRe: Can't run SC remotely to config service Pin
SledgeHammer012-May-13 17:39
SledgeHammer012-May-13 17:39 
GeneralRe: Can't run SC remotely to config service Pin
Dave Kreskowiak3-May-13 1:21
mveDave Kreskowiak3-May-13 1:21 
GeneralRe: Can't run SC remotely to config service Pin
SledgeHammer013-May-13 4:08
SledgeHammer013-May-13 4:08 
GeneralRe: Can't run SC remotely to config service Pin
SledgeHammer013-May-13 7:21
SledgeHammer013-May-13 7:21 
GeneralRe: Can't run SC remotely to config service Pin
Dave Kreskowiak3-May-13 7:52
mveDave Kreskowiak3-May-13 7:52 
GeneralRe: Can't run SC remotely to config service Pin
SledgeHammer013-May-13 8:04
SledgeHammer013-May-13 8:04 
Dave Kreskowiak wrote:
Nope. You're running a command line app and the command prompt is telling you
who it's running as. If the user isn't what you expected it to be, well, that's
a problem in your code, not the test. This is telling you who the SC command is
running as. If that account doesn't have the appropriate permissions to the
target machine to start and stop services, it's going to fail.


Ok Mr. Smarty Pants Smile | :) (j/k)... explain this one... I have just proved again that the impersonation code I am using is working:

using (new Impersonator(_strDomain, _strUsername, _strPassword))
{
System.Diagnostics.Debug.WriteLine(System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString());

System.Diagnostics.Process.Start("CMD", "/K WHOAMI");
}

I have just conducted two tests there... your CMD /K WHOAMI (which returns the wrong non-impersonated logged on user) and WindowsIdentity.GetCurrent() (which CORRECTLY returns the impersonated user!)

I am running on Windows 7 as an admin on my box (but not the remote box), UAC is disabled. So that block of code *is* running as the impersonated user, but Process.Start() seems to be running as non impersonated currently logged on user.
GeneralRe: Can't run SC remotely to config service Pin
Dave Kreskowiak3-May-13 8:26
mveDave Kreskowiak3-May-13 8:26 
GeneralRe: Can't run SC remotely to config service Pin
SledgeHammer013-May-13 9:40
SledgeHammer013-May-13 9:40 
GeneralRe: Can't run SC remotely to config service Pin
SledgeHammer013-May-13 11:10
SledgeHammer013-May-13 11:10 
AnswerRe: Can't run SC remotely to config service Pin
Richard MacCutchan2-May-13 21:37
mveRichard MacCutchan2-May-13 21:37 
GeneralRe: Can't run SC remotely to config service Pin
SledgeHammer013-May-13 4:02
SledgeHammer013-May-13 4:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.