|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
With different credentials.I would like to run the below code using other credentials than the user running it, how can I use different credentials? Thank you, Yahya Dim msgobj msgobj = CreateObject("CDO.Message") msgobj.DataSource.Open(sUrl, , 3) If msgobj.fields("urn:schemas:httpmail:hasattachment").value = True And msgobj.fields("DAV:contentclass").value = "urn:content-classes:message" Then msgobj.attachments.deleteall() msgobj.fields("urn:schemas:mailheader:keywords").value = "Attachment" msgobj.fields.update() msgobj.DataSource.Save() End If msgobj = Nothing Yahya,
Check if the WindowsIdentity.Impersonate Method Allows code to impersonate a different Windows user is what you're looking for Show quoteHide quote "Yahya" <x@x.x> wrote in message news:O25epoROFHA.3400@TK2MSFTNGP10.phx.gbl... > Dear Sirs, > > I would like to run the below code using other credentials than the user > running it, how can I use different credentials? > > Thank you, > Yahya > > Dim msgobj > > msgobj = CreateObject("CDO.Message") > > msgobj.DataSource.Open(sUrl, , 3) > > If msgobj.fields("urn:schemas:httpmail:hasattachment").value = True And > msgobj.fields("DAV:contentclass").value = "urn:content-classes:message" Then > > msgobj.attachments.deleteall() > > msgobj.fields("urn:schemas:mailheader:keywords").value = "Attachment" > > msgobj.fields.update() > > msgobj.DataSource.Save() > > End If > > msgobj = Nothing > > > > You can use impersonation to have ASP.NET run under a different user
account. For example, you can add a line similar to this to your web.config file: <identity impersonate="true" userName="domain\MyUserName"> password="password"/> Here's more info on impersonation: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetimpersonation.asp Show quoteHide quote "Yahya" <x@x.x> wrote in message news:O25epoROFHA.3400@TK2MSFTNGP10.phx.gbl... > Dear Sirs, > > I would like to run the below code using other credentials than the > user > running it, how can I use different credentials? > > Thank you, > Yahya > > Dim msgobj > > msgobj = CreateObject("CDO.Message") > > msgobj.DataSource.Open(sUrl, , 3) > > If msgobj.fields("urn:schemas:httpmail:hasattachment").value = True And > msgobj.fields("DAV:contentclass").value = "urn:content-classes:message" > Then > > msgobj.attachments.deleteall() > > msgobj.fields("urn:schemas:mailheader:keywords").value = "Attachment" > > msgobj.fields.update() > > msgobj.DataSource.Save() > > End If > > msgobj = Nothing > > > >
How to Share Class Properties Across Processes
no indexof-function for collection object available. delete rows from datagrid Finalize and database connection... contradiction in msdn or a misunderstaning from my part ? Open a CSV file What is .NET Redistributable? How do I shell the following command line or process.start it (very different command!) Oledb???? Windows Service and application.DoEvents() Destructor for VB.NET class |
|||||||||||||||||||||||