How to locate a PC running a know service?

I'm working on a client-server application.  The server is installed on a 
machine on the LAN.  Then, the installation CD is inserted into a client PC. 
I'm trying to locate the server programmatically (from the autorun.exe app 
on the CD).

One option I'm doing is enumerating all computers on the LAN, and then 
enumerating all services on each computer, looking for my service.  This 
works for many cases.

I'm trying to use "connect" with *every* IP within the subnet mask -- but it 
takes *forever* for each connect to timeout (about 20 seconds per connect). 
Is there a way to alter the timeout value for a connect?  Is there an easier 
way to hunt down the server running on the LAN?

Thanks
DanB


0
Dan
12/8/2006 11:51:51 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
381 Views

Similar Articles

[PageSpeed] 21

Dan Baker wrote:
> I'm working on a client-server application.  The server is installed on a 
> machine on the LAN.  Then, the installation CD is inserted into a client PC. 
> I'm trying to locate the server programmatically (from the autorun.exe app 
> on the CD).
> 
> One option I'm doing is enumerating all computers on the LAN, and then 
> enumerating all services on each computer, looking for my service.  This 
> works for many cases.
> 
> I'm trying to use "connect" with *every* IP within the subnet mask -- but it 
> takes *forever* for each connect to timeout (about 20 seconds per connect). 
> Is there a way to alter the timeout value for a connect?  Is there an easier 
> way to hunt down the server running on the LAN?
> 
> Thanks
> DanB
> 
> 

Broadcast a UDP message, have the server respond with a message that 
contains its own IP (and port if necessary).

A similar scheme can be based on the mailslot APIs.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
12/9/2006 1:13:40 AM
Depends on how you are connecting to the service.  If you're using a named pipe, just use
the pipe name.  If you're using sockets, but you're on a local network (not a WAN), the
simplest way is to have the service do a UDP broadcast message saying "Here I am",
specifying the IP address and socket where the service is found.  You have to set up to
receive broadcast messages, but that's documented.  However, most routers kill broadcast
messages unless they're configured to create a "virtual LAN" between local subnets, so
watch out for that problem.  

Polling as you describe is about the worst possible way.

And you could also use mailslots in a LAN in the same domain.
					joe

On Fri, 8 Dec 2006 16:51:51 -0700, "Dan Baker" <dbmail> wrote:

>I'm working on a client-server application.  The server is installed on a 
>machine on the LAN.  Then, the installation CD is inserted into a client PC. 
>I'm trying to locate the server programmatically (from the autorun.exe app 
>on the CD).
>
>One option I'm doing is enumerating all computers on the LAN, and then 
>enumerating all services on each computer, looking for my service.  This 
>works for many cases.
>
>I'm trying to use "connect" with *every* IP within the subnet mask -- but it 
>takes *forever* for each connect to timeout (about 20 seconds per connect). 
>Is there a way to alter the timeout value for a connect?  Is there an easier 
>way to hunt down the server running on the LAN?
>
>Thanks
>DanB
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
12/10/2006 4:20:59 AM
I still don't see any way for a workstation to find an unknown server on a 
LAN.

Example: The IT guy inserts my CD into a workstation computer.  The autorun 
starts up and "somehow" detects if my server has already been installed on 
another computer on the LAN.  The autorun app doesn't know the IP address of 
the server, nor the UNC of the server.  It knows nothing.  It is trying to 
"detect" if the server has been installed anywhere on the LAN -- and if it 
has been installed, then it wants to determine the IP/UNC of the machine 
running the server.

Methods I've looked at:
Named pipe -- requires a computer name.
mailslot -- requires a UNC of a computer.
TCP/IP -- requires a computer name/IP.
multicast -- requires the IP of the server computer.

(pulls hair out)

The Windows "My Network Places" can enumerate the various networks found, as 
well as the various computers on the network.
I've got code to enumerate the computers on my LAN -- and this works most of 
the time.

What I really want is the example above -- my app can scream out over the 
network "Is my server running anywhere on this LAN?"

Thanks
DanB




"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:sf2nn29vt9egaequ5mmmtbu9irpc4a0sq9@4ax.com...
> Depends on how you are connecting to the service.  If you're using a named 
> pipe, just use
> the pipe name.  If you're using sockets, but you're on a local network 
> (not a WAN), the
> simplest way is to have the service do a UDP broadcast message saying 
> "Here I am",
> specifying the IP address and socket where the service is found.  You have 
> to set up to
> receive broadcast messages, but that's documented.  However, most routers 
> kill broadcast
> messages unless they're configured to create a "virtual LAN" between local 
> subnets, so
> watch out for that problem.
>
> Polling as you describe is about the worst possible way.
>
> And you could also use mailslots in a LAN in the same domain.
> joe
>
> On Fri, 8 Dec 2006 16:51:51 -0700, "Dan Baker" <dbmail> wrote:
>
>>I'm working on a client-server application.  The server is installed on a
>>machine on the LAN.  Then, the installation CD is inserted into a client 
>>PC.
>>I'm trying to locate the server programmatically (from the autorun.exe app
>>on the CD).
>>
>>One option I'm doing is enumerating all computers on the LAN, and then
>>enumerating all services on each computer, looking for my service.  This
>>works for many cases.
>>
>>I'm trying to use "connect" with *every* IP within the subnet mask -- but 
>>it
>>takes *forever* for each connect to timeout (about 20 seconds per 
>>connect).
>>Is there a way to alter the timeout value for a connect?  Is there an 
>>easier
>>way to hunt down the server running on the LAN?
>>
>>Thanks
>>DanB
>>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm 


0
Dan
12/22/2006 4:59:11 PM
Dan Baker wrote:
> I still don't see any way for a workstation to find an unknown server on a 
> LAN.
> 
> Example: The IT guy inserts my CD into a workstation computer.  The autorun 
> starts up and "somehow" detects if my server has already been installed on 
> another computer on the LAN.  The autorun app doesn't know the IP address of 
> the server, nor the UNC of the server.  It knows nothing.  It is trying to 
> "detect" if the server has been installed anywhere on the LAN -- and if it 
> has been installed, then it wants to determine the IP/UNC of the machine 
> running the server.
> 
> Methods I've looked at:
> Named pipe -- requires a computer name.
> mailslot -- requires a UNC of a computer.
> TCP/IP -- requires a computer name/IP.
> multicast -- requires the IP of the server computer.
> 
> (pulls hair out)

A UDP broadcast does not need any information about the computer you are 
trying to find.  You can consider having the server send out such a 
broadcast periodically, or having your app send out a "where are you" 
broadcast, or even both.  (You'll want it to work even if the server moves.)

-- 
Scott McPhillips [VC++ MVP]

0
Scott
12/22/2006 5:46:22 PM
Reply:

Similar Artilces:

How do Load at Run Time DLL's work?
In the example of dll's loaded at runtime they use LoadLibrary and GetProcAddress. The LoadLibrary works for me, but the GetProcAddress doesn't. Well it did for a short time yesterday for no apparant reason, then it quit and wont work today. Anyway, when it was working, the parameter wasn't passed correctly to the dll function. So how does the compiler know what the parameter list is for the dll function? I don't have an h file included or anything to tell the calling program what the parameters can be. Here some some code from the dll In MEP.h class CMEPApp : public CWinApp...

SBS 2003: adding Exchange services to Outlook 2003
On 3 out of 8 new computers added to the domain, I am unable to add the Exchange service to Outlook 2003 for the shared public folders and contacts. I receive the following message: "The action could not be completed. The connection to the MS Exch Srvr is unavailable. Outlook must be online or connected to complete the action." All other services are availabe to these "problem" users: One of these users was an existing user that received a new workstation; the other 2 users are new as are their workstations. Any thoughts? Thanks. Michael In news:1D0046BA-38...

xl file running slow
Dear Excel Masters, I have a problem in 1 excel file (other files are ok), when ever i excecute any function or action ( copy / cut / paste / edit...etc..) it takes long time to come back to ready mode, file is also not big, i noticed, in the status bar it says "Calculating Cell : 00%" after few min it will come back to ready mode.. then only i can work on this file. anybody can give solutions for this. with thanx C NARASIMHA PRASAD. -- chinaprasad ------------------------------------------------------------------------ chinaprasad's Profile: http://www.excelforum.com/me...

Looking for advice on PC Cloning?
I finally have enough of the same model computers where I can start to think about cloning... I found this review and wanted to see if anyone has any advice on what I should use. http://disk-imaging-software-review.toptenreviews.com I've used "Norton Ghost" a few years back, it worked well and I suspect it's been updated since I used it... The Paragon and Norton Ghost both have a Change SID option. When I used Ghost before I used a Microsoft utility SysPrep, I believe it wiped the SID and then I would make a copy of the disk\partition... Any real world a...

Services-Core
Hello! Can somebody tell me, then is needed to use Services Core Maybe in an example. http://www.pictureupload.de/originals/pictures/200510215808_FRAGE_Core_Services.png Thanks a lot in advance. Michaela "Michaela Brauner" <m_B@MNEWS.de> wrote in message news:uMrYlbF%23KHA.5476@TK2MSFTNGP06.phx.gbl... > Can somebody tell me, then is needed to use > > Services > Core > > Maybe in an example. > http://www.pictureupload.de/originals/pictures/200510215808_FRAGE_Core_Services.png Are you asking about the specific items tha...

multiple SQL Jobs running
I have a customer that is having issues with SQL jobs being duplicated. The SQL jobs include db backups and data imports. The result of this issue is that there would be duplicate backup (.bak) files and multiple data imports. This fill up disk space fast and the data imports are corrupted. If I stop SQL Agent or the SQL jobs, those SQL backups and imports still run, but it does only one instance! However, it's a mystery of how it's being processed since the SQL agent and jobs are disabled. This issue just started to occur over the past two weeks. We tried rebooting ...

At least one front-end server in this administrative group is running and older version
Here is my Scenario... I have an Exchange 2003 Back-End server that I would like to install SP2 on. I also have an Exchange 2000 FE server that is only used to house the Microsoft Exchange\CRM Queue connector. The version of CRM is 1.0 and I am hesitant to upgrade this FE server in any fashion as it is also my production CRM server. This FE server does not interact with the BE in any way other than basic SMTP mail routing. Does anyone have any workarounds so that I can upgrade my BE server to E2K3 SP2 without modifying the FE in any way. Lastly, does anyone know if MS CRM 1.0 exchange queue c...

GP Dynamics 9 and Windows 2003 Service Pack 2
If we install Windows 2003 service pack 2, would this interfer with our current version of GP Dynamics 9.0? Chris, Should be no problem, we have customers running it with GP 9.0. -- Victoria Yudin Dynamics GP MVP Flexible Solutions, Inc. "Chris" <Chris@discussions.microsoft.com> wrote in message news:25D4E1BA-CF22-45EE-97F2-9BE2244D590D@microsoft.com... > If we install Windows 2003 service pack 2, would this interfer with our > current version of GP Dynamics 9.0? thank you for quick response.... much appreciated! "Victoria [MVP]" wrote: > Chris, ...

executing code on access forms on different pc's
We have several access databases that we used without any problems for years. All databases are in access2003 format and have forms with VB code behind it. recently we are getting new PC's that cannot execute the forms in (MDE version) databases. It reports missing references. Opening the MDB version is no problem but then it cannot be opened on the older PC's anymore. Both old and new PC's have Office 2003 installed and are running XPSP2. The missing references are 3 files: Comct232.ocx Comdlg32.ocx mscomct2.ocx Does anyone know where these files come from? Could they belon...

How to insert a node at a specific location in XML Doc
Hello. Let's say I have the following XML document: <ROOT><Element1>Some Text</Element1></ROOT> I want to add a new element after Element1. I tried the following but, naturally, it doesn't work: Dim oElem as XmlElement Dim oNode as XmlNode Dim oRoot as XmlNode Dim oDoc as New XmlDocument oDoc.LoadXML("<ROOT><Element1>Some Text</Element1></ROOT>") oRoot = oDoc.DocumentElement oNode = oRoot.SelectSingleNode("//ROOT/Element1") oElem = oDoc.CreateElement("InsertMe") oElem.InnerText = "A New Element&q...

Unable to start processing services. #2
this is a pIII with microsoft xp+sp2 and office xp+sp3. whenever i start Ms outlook, a windows pop up saying: "<B>unable to start processing services. could not open the item. try again.</B>" what is that and how can i solve it. appreciate your quick reply. ...

PC freezes windows 7
Hi, Have had this problem for a long time (6 months). My PC freezes intermittently and I have to restart manually sometimes this is once, other times it might happen 5 times a day. It occurs randomly, not always when I am using the PC. I could be away from the computer and check and it could be frozen. Acer told me it was a memory problem and they fixed it (supposedly) but it still freezes intermittently. Then the image of the OS was corrupt so they had to reinstall from their disc. It seemed better in winter, so I thought it might be the fan, but it seems sometimes to d...

Can I run two projects simultaneously
Hi! All, I need to be able to run two projects simultaneoulsy as part of one big project. Can I do this. If yes, could you please tell me an easy way to do it. Both these projects share some common dtaa between them. thanks best regards, Are you saying you want to run two executables simultaneously? If yes, nothing stops you from doing it. However, when you say these are sharing common data, are they in same process? If not, what does common data mean? If yes, how do you plan to achieve it? Is it a COM object? ---------- Ajay Kalra ajaykalra@yahoo.com RM wrote: > Hi! All, > I need ...

Excel services question
A question about Excel Services in 2007 if I may? I have a remote system offering a dataset that updates every second using standard web services. Assuming a decent connection, could I chart that data in Excel 2007 in real-time using Excel services? What would be the best way of going about it and are there any good online guides to that? Many thanks in advance ...

Deletion service cannot clean up tables
I get the deletion service logging in the Application log every 10 minutes the following error: Event ID: 5895 Source MSCRMDeletionService Error: Can't clean up the following tables: Account; Activity. I have CRM and SQL on separate machines and used a custom user, promoted as a domain admin to install CRM???? Is this something I can clean up in CRM or is there a log for this service somewhere???? Many thanks Chris. Chris, There is a known issue with the deletion service when it tries to delete records that have attacments associated with them. You can manually fix this by...

constant restart of msexcimc service help..
I have been running across very slow opening of sub containers within my mailboxes. Sometimes to the point where the requesting information window pops up and sits for a long time and never connects... I found that re- applying sp4 sometimes works.. Yet I found that a quick restart of the \msexcimc.exe service is all that is need to make the connect fast and eliminate the non connect.. any ideas what is going on here? any ideas how to patch this?? I hate having to do this once a day.. =( Thanks... "ROb B" <anonymous@discussions.microsoft.com> wrote: >I have been...

How do I set up the account I don't know my pop3 or smtp number
I am trying to get my msn account to run through outlook but can't locate my pop3 or smtp number to connect to the server. Suggestions? you need to use http account type, not pop/SMTP. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Subscribe to Exchange Messaging...

MODIFY a menu of a running MDI Application
Hello. I have a stupid problem with my MDI App. This App manages different CMDIChildWnds. Some of the dialogs have a special menu, that means, it has to be modified before loading, cause in the menu ressource are a lot of menu entries, but i only want to display some of them. So i wrote a method in CMAinFrame::PrepareMenu. In this method i load the current menu and delete all submenues i don't want to be displayed. In the associated CMDIChildWnd::OnMDIActivate i call this method, when a childframe is activated (bActivate == TRUE). This works fine. Now my problem. When i maximize a dia...

Running an application remotely
Ok, not too sure this should really be in the MFC forum, but it deals with an MFC question so..... Anyways, I have an MFC app which basically just connects to the serial port for communication with a satellite device. Now I can run the program from another computer (over the network) and it opens up, etc fine, but I want to know, can I open a program across the network and get it to use the serial port of the computer that the program resides on??? Right now if I use computer A to open the program on Computer B (which has the only copy of the program and the only satellite) it tried t...

Pocket PC Outlook
How do you change the work week start and finish times? Try microsoft.public.pocketpc Don wrote: > How do you change the work week start and finish times? ...

Calculating latest running 3 month total
Hi everyone, It's my first time posting so I hope I am asking a not too basic question...I tried searching for previous posting relating to this but had no luck. My question is, I have a worksheet with months starting in July 07 - June 08. Each month, as data become available, a new month's of data will be added to the worksheet. If possible, I'd like another column in my worksheet to always calculate the lastest three months. For the first couple of months, July 07 and August 07, as there will be less than three month's worth of data, it would only calculate what's ...

How to know when a SmartList is run
Is there any way to determine or track which users are running which SmartLists? -- Jim@TurboChef ------=_NextPart_0001_30D9B3C7 Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello, Thanks for the great question. There is not activity tracking on Smarlists or Smartlist Builder. Your inquiry is a great product suggestion. Recommendation is to submit the suggestion to Product Suggestion for future product enhancement consideration. The url link for your quick access is - https://mbs.microsoft.com/customersource/productfeedback/ I am not aware of any add-on product off...

AutoFill pattern based on cell locations #2
Hi, I have a list of addresses that need to be in a different format. The addresses are currently in this format: Atria Chandler Villas 101 S. Yucca Street Chandler, Arizona 85244-8419 (blank cell) Atria Bell Court Gardens 6653 E. Carondelet Drive Tucson, Arizona 85710-2155 520.886.3600 (blank cell) Atria Campana del Rio 1550 East River Road Tucson, Arizona 85718-5800 520.299.1941 I need them in rows instead of columns, like this: Atria Chandler Villas 101 S. Yucca Street Chandler, Arizona 85244-8419 Chandler, Arizona 85244-8419 The pattern is as follows for the names: =B1 =B6 =B11 ...

OnSave JavaScript elements not running
Hi All We have been running Microsoft CRM in the firm for just over a year. We have experienced numerous problems but thankfully many of them have been sorted out. Custom JavaScripts for the OnLoad and OnSave event on Company and Contact forms were created and were running beautifully until... Update Rollup 2 was installed two (2) weeks ago. For some reason, our OnSave code does not run certain elements contained within it. There are no errors within the code because the code did run before the installation of Rollup 2. No error messages are being reported, the system shows something ...

accessing crm via RWW or terminal service ?
Hi , Can anyone pls give me some help on using CRM 3.0 via terminal server or remote web workplace. This way we dont need to worry about VPN's and give outlook or webaccess within the terminal/RWW itself.. any feedback ? thanks Thanks Larry. Very helpful. "Larry Lentz [CRM MVP]" <LarryLentzCRMMVP@discussions.microsoft.com> wrote in message news:7AE62280-4345-4405-8C1A-DE41ABD7772A@microsoft.com... > Accessing CRM via RWW and Terminal Services/RDP is no problem. If you can > log > into your workstation via RWW or RDP, you can certainly access CRM if you ...