Midtown Computer Systems Enterprise

Convenient web based access to our favorite computer related Usenet groups.
MCSE.MS is not affiliated with Microsoft corporation, Cisco corporation, Oracle, CompTIA or any other vendor.
Check our Computer Hardware forum | Cell Phones reviews

Go Back  MCSE > Microsoft software reviews > Dot Net tutorials > .NET Security


.NET Security microsoft.public.dotnet.security

 
 
Thread Tools Display Modes
  #1  
Old 04-06-05, 06:22 PM
Chris Williams (Sirana)
File.Copy to UNC path location with service
I've got a two line code snippet that copies a file from a local directory to
a server share that's accessed via a UNC path.

When I run this code snippet in a Windows forms app, while logged in as
myself, it runs fine and the file is copied.

When I run this code snippet in a Windows service, even when the service is
running under my account, the code snippet fails with a
system.unauthorizedaccess exception and the file copy fails.

I've verified in the service code that the service is running under my
account right at the point of failure. The account happens to be a domain
administrator account. Also, the share on the remote server has Full Access
granted to this account.

Any ideas would be appreciated.
--------------------
Chris Williams
Sirana Software
www.sirana.com
  #2  
Old 04-07-05, 06:23 PM
richlm
Re: File.Copy to UNC path location with service
This sounds like a delegation issue. Basically you have to give your domain
account enough privilege to allow one server to do stuff on another server.

With a domain at Windows 2000 functional level it's either on or off per
user account:
1.. Within the Users folder of Active Directory Users and Computers,
right-click the user account that is used to run the server process that
will impersonate the client, and then click Properties.
2.. Click the Account tab.
3.. Within the Account options list, scroll down and click Account is
trusted for delegation.
If your domain controller is Windows 2003 and you raised the functional
level you can configure things to a much finer level of detail, for example
"services running as account A on Server1 can access file shares on
Server2". As above but on properties there's a new delegation tab. Here's a
link if you need the finer details:
http://www.microsoft.com/technet/pro.../constdel.mspx

Hope this helps.



 


Popular forums
A+ (A Plus) Windows 2000 Active directory Exchange 2000 information store
Network+ Windows XP Security Exchange 2000 server administration
MCSE .NET Web services SQL Server
Cisco certification ASP .NET SQL 2000 Programming
Windows 2000 Registry .NET XML Viruses


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:24 AM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright MCSE braindumps 2003-2006