473,473 Members | 1,999 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

With different credentials.

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
2 2012
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Julie | last post by:
I have a page that authenticates users by reading Request.ServerVariables("AUTH_USER") and Request.ServerVariables("AUTH_TYPE"). When users try to access this page from windows NT/2000, it works...
36
by: Thomas | last post by:
after spending countless hours trying, i give up and hope to get some help in here. on server1 i got the web myweb.com with my test.asp. in the test.asp, i'm trying to read a file from an UNC...
1
by: Grey | last post by:
my web server is in domain. how can I check the user login with the AD's user account?? does it required the client's browser and web server located in the same domain?? and what is the different...
3
by: Jørn A. | last post by:
I'm working on a web based user interface for a job scheduling system (running scripts). The system is using a non-windows scheduler software, but it's installed and running as a windows...
2
by: Yahya | last post by:
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
3
by: breeto | last post by:
If you've configured .NET Remoting to use more than one channel of the same type, for example two TcpClientChannels with unique names, when you want to create a proxy to a remote object how do you...
0
by: jonoaustin | last post by:
Hi there I need to be able to copy some files between two different network share locations using credentials other than the logged in user (AD domain based users). Is there a simple way to...
2
by: =?Utf-8?B?Z292ZXI=?= | last post by:
Hello, I want to provide the ability to log on to a web application on our intranet using different credentials like they do in Sharepoint 2007. When a user hits the site, i want him...
2
by: IronMike | last post by:
I'm writing a program that needs to write files to a network share. My problem is that the program users are working on PCs that are not connected to our domain and the program needs to save files to...
5
by: =?Utf-8?B?R3JhbnQ=?= | last post by:
Hi, In a WinForms application, how can you get the identity of the remote credentials used when kicking off the application with RunAs /NetOnly? I can get local Identity information with...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.