1

We have a WCF service that is meant to copy an existing file from its host server to a folder on another server on a different domain (using a UNC path). We were able to do this using delegation (using LogonUser() imported from ADVAPI32.dll).

The destination file share has now been reconfigured under a DFS, and the delegation approach no longer works. There is no trust configured between the two domains (this is beyond our control).

We considered mapping a drive (we have the credentials to do it), but since the WCF service runs without an active user session, it will not work.

Is there a way for a WCF service to copy a file to a file share on another, untrusted domain?

yelxe
  • 186
  • 1
  • 7
  • See the accepted answer here http://stackoverflow.com/questions/659013/accessing-a-shared-file-unc-from-a-remote-non-trusted-domain-with-credentials/684040#684040 – Allan Elder Jun 06 '14 at 15:48
  • ^ I just tried to implement WNetUseConnection. While it works when run against localhost, it fails when running under the NetworkService identity on the host server (probably for the same reason a drive mapping would fail). – yelxe Jun 06 '14 at 19:50

0 Answers0