By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,162 Members | 1,486 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,162 IT Pros & Developers. It's quick & easy.

With different credentials.

P: n/a
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").v alue = "Attachment"

msgobj.fields.update()

msgobj.DataSource.Save()

End If

msgobj = Nothing


Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Yahya,

Check if the
WindowsIdentity.Impersonate Method
Allows code to impersonate a different Windows user is what you're looking
for

"Yahya" <x@x.x> wrote in message
news:O2**************@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").v alue = "Attachment"

msgobj.fields.update()

msgobj.DataSource.Save()

End If

msgobj = Nothing

Nov 21 '05 #2

P: n/a
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/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Yahya" <x@x.x> wrote in message
news:O2**************@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").v alue = "Attachment"

msgobj.fields.update()

msgobj.DataSource.Save()

End If

msgobj = Nothing

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.