Using the Tridion 2011 Event System I have some code that modifies a text file whenever a Page is published.
If I set a page to publish via the Content Manager the code runs fine.
If I set a page to publish via Core Service it doesn't work. Looking at the Tridion event log on my Content Manager Server I get an error
Access to the path '\\server1\folder1\textfile.txt' is denied.
Component: Tridion.ContentManager
Errorcode: 0
User: NT AUTHORITY\NETWORK SERVICE
...
I know the NETWORK SERVICE
account does not have access to this share and I'm not sure I want to give it the required Read/Write access. I assume that when publishing via Content Manager the event system code runs under a different user (in my case maybe tcmcoreservice
).
Any ideas why it acts differently and how I can solve this? I'm a bit confused.
Update
My endpoint
<endpoint address="http://mydomain.com/webservices/CoreService2011.svc/basicHttp"
binding="basicHttpBinding" bindingConfiguration="basicHttp"
contract="Tridion2011CoreService.ICoreService"
name="basicHttp" />
My binding
<binding name="basicHttp" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="TransportCredentialOnly">
<transport
clientCredentialType="Windows"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
And to confirm I am using CoreServiceClient
using (var client = new CoreServiceClient())
{
... publish code here ...
}