Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9105155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:02:01+00:00 2026-06-17T02:02:01+00:00

I have a service on Windows 2003 Server that needs to access a webdav

  • 0

I have a service on Windows 2003 Server that needs to access a webdav resource as a UNC Path. The purpose of this service is to verify (and take corrective actions) webdav functionality to sharepoint. The idea is to write a file to sharepoint, and verify it’s contents. If something goes wrong and the threshold was exceeded the mrxdav and webclient service will be restarted.

I run the service under a service account that is local admin on the 2003 server and has access to the sharepoint “folder”. (I verified this by logging in with the service account and write a file to the same folder).

When the service tries to write a file to this folder it fails with ACCESS DENIED, process monitor shows that the service runs under LocalSystem and Impersonates my service account

enter image description here
enter image description here
enter image description here

I also tried to Impersonate the service account from my code using LogonUser and LogonUserEx (with the various options for logon interactive, network, network cleartext and providers) followed by ImpersonateUser but all result in the same ACCESS DENIED.

I presume this is something specific to a service using the WebClient service.
My code is written in Delphi but I’ve added the c tags as well to attract more readers since I don’t think my problem is Delphi related.

EDIT: Perhaps relevant, I am running a seperate Thread that actually accesses the WebDav share.

EDIT: As a workaround I am create a network connection using explicit credentials using the following code:

function TGuardThread.Map(const Username: String; var Password: String;
  const Domain: String): Boolean;
var
  nr: NETRESOURCE;
  dwRes: DWORD;
begin
  try
    ZeroMemory(@nr, SizeOf(nr));
    nr.dwType := RESOURCETYPE_ANY;
    nr.lpRemoteName := PChar('\\mywebdavroot\myfolder');

    dwRes := WNetAddConnection2(nr, PChar(Password),
      PChar(Format('%s\%s', [Domain, Username])), CONNECT_UPDATE_PROFILE);

    Result := dwRes = NO_ERROR;
  finally
    if Length(Password) > 0 then
      SecureZeroMemory(@Password[1], Length(Password) * SizeOf(Char));
  end;
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:02:03+00:00Added an answer on June 17, 2026 at 2:02 am

    Workaround is to use an explicit connection with credentials to the WebDav server, like this:

    function TGuardThread.Map(const Username: String; var Password: String;
      const Domain: String): Boolean;
    var
      nr: NETRESOURCE;
      dwRes: DWORD;
    begin
      try
        ZeroMemory(@nr, SizeOf(nr));
        nr.dwType := RESOURCETYPE_ANY;
        nr.lpRemoteName := PChar('\\mywebdavroot\myfolder');
    
        dwRes := WNetAddConnection2(nr, PChar(Password),
          PChar(Format('%s\%s', [Domain, Username])), CONNECT_UPDATE_PROFILE);
    
        Result := dwRes = NO_ERROR;
      finally
        if Length(Password) > 0 then
          SecureZeroMemory(@Password[1], Length(Password) * SizeOf(Char));
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a windows service (currently running under Windows 2003 Server) that needs to
I have a Windows Server 2003 system that is used for terminal services. We
We have several apps that run on a Windows 2003/2008 server. Some of these
We have a .NET Windows Service that occasionally shuts down on one particular server,
I have developed an ASP.NET application that includes a WCF service. This service needs
I have built software that I deploy on Windows 2003 server. The software runs
I have a Windows 2003 Server that uses IIS to host a legacy ASP.NET
I have an ASP.NET application which runs in Windows Server 2003. In this application
I have a bit of code that needs to sit on a windows server
I have just installed SQL Server 2008 including Reporting Services on Windows Server 2003.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.