Re: C# windows service blues

From: Dominick Baier [DevelopMentor] (dbaier_at_pleasepleasenospamdevelop.com)
Date: 07/06/05


Date: Tue, 05 Jul 2005 23:56:20 -0700

Hello Panayotis,

so - i guess this proxy does windows integrated authentication.

Are you using HttpWebRequest for downloading??

This class has a .Proxy property where you can set the proxy.

The WebProxy class in turn has a .Credentials property.

To authenticate against the proxy using windows auth you set

proxy.Credentials = CredentialCache.DefaultCredentials;

and assign the proxy to the webrequest

that should do the trick.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> Hi,
>
> I have created a web service using C# that needs to check whether some
> XML files are updated, if they are, it downloads them (saves them to
> disk) and processes them by updating data in a back-end MS SQL
> database.
>
> The client has a proxy server installed on their network and they
> request that the windows service be run under a low privileged account
> that will only be able to download the XML files through the proxy as
> well as insert/update/delete data in the MS SQL database.
>
> In addition, they do not want to store the proxy info (server name,
> username, password and domain) to a file, even in encrypted form, but
> they request that the windows service should "automagically" download
> the files via the proxy server by retrieving the SID token of the user
> account under which the windows service will be run from time to time.
>
> I am no expert in this, so I do not know if it is doable. How can I
> retrieve the SID of the currently "service user account" in order to
> present the appropriate network credentials to the proxy server and
> download the files ?
>
> Can anyone give any pointers, code examples, anything really ?
>
> Clueless,
> Thank you for your help.



Relevant Pages

  • RE: PTError: 0x80244017
    ... You cannot download updates when you access the Windows Update Web site from ... a Windows XP-based computer that is behind a firewall or a proxy server ... Proxy setting problem IMHO ...
    (microsoft.public.windowsupdate)
  • Re: cannot update due to error: 0xC80003FB
    ... when you try to use the Windows Update Web site or the Microsoft Update ... Remove the proxy server entry from the WinHTTP ... "dannz53" wrote: ... Download and SAVE Download and save what?? ...
    (microsoft.public.windowsupdate)
  • Re: cannot update due to error: 0xC80003FB
    ... dannz53 wrote: ... Either the proxy server or target server name can not be resolved. ... Under " On This Page ", click the 'How to download and install the update package that includes BITS 2.0 and WinHTTP 5.1 for Windows 2000' ... Download and SAVE Download and save what?? ...
    (microsoft.public.windowsupdate)
  • Re: Windows Media Center Update
    ... February 2010 Cumulative Update for Windows Media Center TV Pack for Windows Vista ... First try - Remove the proxy server entry from the WinHTTP proxy configuration ... " To remove the proxy server entry from the WinHTTP proxy configuration for Windows Vista, ... but when I launched it in WMC it ...
    (microsoft.public.windowsupdate)
  • Re: Microsoft Fix It for Windows 7/Windows Server 2008 R2
    ... Although the KB article doesn't list Win 7 in the APPLIES TO, Microsoft Support has been recommending the tool for Windows 7 in the Windows Update forum. ... Advanced Method B: Remove the proxy server entry from the WinHTTP proxy configuration:) ... To remove the proxy server entry from the WinHTTP proxy configuration for Windows 7 or Windows Vista, ...
    (microsoft.public.windowsupdate)