Used a domain user, who has rights on the folder where I was copying. Did another cool thing, starting a batch job on a remote server from SharePoint application page, using
http://technet.microsoft.com/en-us/sysinternals/bb897553 The app page exports major version from SharePoint on demand than starts a batch job which starts the BI things on file. Cheers On Tue, Sep 25, 2012 at 10:52 AM, Web Admin <[email protected]>wrote: > Great. Which values are you passing through for userName, domain, > password? The logged in user, or a user with higher privileges? > > > On 21 September 2012 12:33, Ajay <[email protected]> wrote: > >> Hi Paul, >> >> I was getting access denied message from client machines, using >> impersonation from below article resolved it >> >> http://support.microsoft.com/kb/306158 >> >> Just wrapping file copy code , >> >> if (ImpersonateValidUser(userName, domain, password)) >> { >> using (var fileStream = new >> FileStream(filePathAndName, FileMode.Create, FileAccess.ReadWrite)) >> { >> using (var binaryWriter = new >> BinaryWriter(fileStream)) >> { >> binaryWriter.Write(bytes); >> } >> } >> UndoImpersonation(); >> Console.WriteLine(downloadDetails.ToString()); >> } >> >> >> >> >> >> On Fri, Sep 21, 2012 at 10:37 AM, Web Admin < >> [email protected]> wrote: >> >>> Sounds like firewall. Can u confirm that SMB traffic is allowed between >>> the SP server and file share? >>> >>> On 20 September 2012 13:02, Ajay <[email protected]> wrote: >>> >>>> I am creating a application page which gets the last major version >>>> and copies it to a folder on file share. >>>> >>>> I have created a Shared folder where it should be copied to, and given >>>> write rights to the folder. I have also given rights to Everyone >>>> >>>> If I run the application page from dev server, it creates the file to >>>> the network share. TM1 is the name of the share, I have tried the full >>>> path \\gxxxxx72\D$\Ajay_EMS\TM1, but same result >>>> >>>> const string downLoadpath = @"\\gxxxxx72\\TM1\"; >>>> var filePathAndName = downLoadpath + excelFile.Name; >>>> if (bytes == null) return; >>>> using (var fileStream = new FileStream(filePathAndName, >>>> FileMode.Create, FileAccess.ReadWrite)) >>>> { >>>> using(var binaryWriter = new >>>> BinaryWriter(fileStream)) >>>> { >>>> binaryWriter.Write(bytes); >>>> } >>>> } >>>> >>>> When I run this application page from client machine, I get an access >>>> denied error, works from dev server. >>>> >>>> I know this is more asp.net thing than sharepoint. >>>> >>>> Do you have any impersonation class or any code which will make it work. >>>> >>>> Any other advice welcome, this is internal environment, so I can give >>>> permissions etc what is required. >>>> >>>> >>>> _______________________________________________ >>>> ozmoss mailing list >>>> [email protected] >>>> http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss >>>> >>>> >>> >>> >>> -- >>> Regards, >>> >>> Paul Noone >>> >>> SharePoint Farm Admin/Developer >>> Infrastructure Team >>> CEO Sydney >>> >>> p: (02) 9568 8461 >>> f: (02) 9568 8483 >>> e: [email protected] >>> w: http://www.ceosyd.catholic.edu.au/ >>> >>> >>> _______________________________________________ >>> ozmoss mailing list >>> [email protected] >>> http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss >>> >>> >> >> _______________________________________________ >> ozmoss mailing list >> [email protected] >> http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss >> >> > > > -- > Regards, > > Paul Noone > > SharePoint Farm Admin/Developer > Infrastructure Team > CEO Sydney > > p: (02) 9568 8461 > f: (02) 9568 8483 > e: [email protected] > w: http://www.ceosyd.catholic.edu.au/ > > > _______________________________________________ > ozmoss mailing list > [email protected] > http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss > >
_______________________________________________ ozmoss mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
