Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > With different credentials.

Reply
Thread Tools

With different credentials.

 
 
Yahya
Guest
Posts: n/a
 
      04-04-2005
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




 
Reply With Quote
 
 
 
 
Pipo
Guest
Posts: n/a
 
      04-04-2005
Yahya,

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

"Yahya" <> wrote in message
news:...
> 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
>
>
>
>



 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      04-04-2005
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" <> wrote in message
news:...
> 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
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different languages in different controls chanmmn ASP .Net 2 09-07-2004 07:24 PM
Different responses from different systems Tigerhillside Perl 3 02-23-2004 01:56 AM
Re: How do I show different user control on different querystring ? Kevin Spencer ASP .Net 0 08-25-2003 12:49 PM
Re: How do I show different user control on different querystring ? Dotnetjunky ASP .Net 0 08-25-2003 12:22 PM
Bind different rows to different data sources in data grid AD ASP .Net 1 08-23-2003 10:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57