473,653 Members | 3,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web Service invoke as NT User

** This is the windows form code **

Private Sub btn_log_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles btn_log.Click
Dim msg As String
Dim ws As New ADWS.Service
msg = "testing this mail message"
Dim mail As New Net.Mail.SmtpCl ient
mail.Host = "exchange server"
mail.UseDefault Credentials = True
'mail.Send(getm ail.GetCurrentU serEmail, "u...@email.co. nz", "call
request", msg)
MessageBox.Show (ws.GetCurrentU serEmail)
End Sub
** This is the webservice code **
<WebMethod()_
Public Function GetCurrentUserE mail() As String
Dim dSearch As DirectorySearch er = New DirectorySearch er()
dSearch.SearchR oot = New DirectoryEntry( "LDAP://DC=Domain
name,DC=co,DC=n z", "CN=user,OU=Use rs,DC=domain name,DC=co,DC=n z",
"password")
dSearch.Filter = "(&(objectCateg ory=User)(samAc countName=" +
Environment.Use rName + "))"
Dim sResult As SearchResult = dSearch.FindOne ()
Dim currentUser As DirectoryEntry = sResult.GetDire ctoryEntry()
Return currentUser.Pro perties("mail") .Value.ToString ()
End Function
When I try to run ws.getcurrentus eremail() it invokes the web service
as IUSR_Computerna me.
How ever if I run the web service directly it runs as my account
domain
\username
How do I get the web service to run from the windows app as the
locally logged on user?

Jul 5 '07 #1
0 926

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
1921
by: Mr. B | last post by:
I've an application in which I use to check out the date/time stamp of a data base... and if I find that it has been updated, my application runs and does a particular update. Currently I fire off my application hourly useing the built in XP Scheduler. What I am going to do is to have my application check every minute while it is running as I don't want to have to wait up to a hour for my particular update to happen....
11
1157
by: Mr. B | last post by:
I've an application in which I use to check out the date/time stamp of a data base... and if I find that it has been updated, my application runs and does a particular update. Currently I fire off my application hourly useing the built in XP Scheduler. What I am going to do is to have my application check every minute while it is running as I don't want to have to wait up to a hour for my particular update to happen....
11
306
by: Mr. B | last post by:
I've an application in which I use to check out the date/time stamp of a data base... and if I find that it has been updated, my application runs and does a particular update. Currently I fire off my application hourly useing the built in XP Scheduler. What I am going to do is to have my application check every minute while it is running as I don't want to have to wait up to a hour for my particular update to happen....
13
1939
by: NG | last post by:
Hi All I made a windows service in C#. Now I have a situation where I need to invoke an exe with some UI. Assuming that the computer running this service will always be logged in, can anyone please provide me a sample code to invoke an exe from windows service in .net. I tried a few methods that I found on the net but they seem to invoke something in the background which actually does not work. Any help is much appreciated. Thanks in...
3
13789
by: =?Utf-8?B?RGFuZGFuIFpoYW5n?= | last post by:
Now I have a web application, a web service and a SQL Server database. The Web application will invoke the web service, the web service invokes the SQL Server stored procedure. I let the web service run in an application pool which runs under a domain user, this domain user has permissions of accessing database and the connection to database is trusted connection. All these work well. The web application will be used in internet (not...
0
8370
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8283
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8590
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4147
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2707
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.