What is event ID for dhcp-client IP lease? (Or ia there a better way?)


  1. Posts : 8
    Windows 7 64bit
       #1

    What is event ID for dhcp-client IP lease? (Or ia there a better way?)


    Hi,

    I need to do a net use when an IP is assigned via DHCP. The only way that I can find to do this is to schedule a task based on a logged event. To do this I need to specify

    • the log (I picked "Microsoft Windows DHCP Events/Admin")
    • the source (I picked Dhcp-Client)
    • the event ID (this is what I can't figure out)

    I looked at the logs with the Event Viewer and found a bunch of dhcp-client log entries but none of them were "successful IP lease" or words to that effect.

    I get tons of these: (50067) Dhcp has received network hint 146514C4F4E4 for the Network Card with the network address 0x4025C2636874

    and, while meeeing with the router) a few of these: (1001) Your computer was not assigned an address from the network (by the DHCP Server) for the Network Card with network address 0x4025C2636875. The following error occurred: 0x79. Your computer will continue to try and obtain an address on its own from the network address (DHCP) server.

    but I never saw something indicating a successful lease and I know there was one or I couldn't be posting this question!

    OR IS THERE A BETTER WAY to schedule a task when an IP is assigned?
      My Computer


  2. Posts : 6
    Windows 7 Home Premium 64-bit SP1
       #2

    There is event id 50058 from DHCP that says Your computer was successfully assigned an address from the network... I have to say that I've never seen it in a log. Do you need to know when a new IP is assigned? Or simply when it gets TCP/IP connectivity?
      My Computer


  3. Posts : 8
    Windows 7 64bit
    Thread Starter
       #3

    AdiGri said:
    There is event id 50058 from DHCP that says Your computer was successfully assigned an address from the network... I have to say that I've never seen it in a log. Do you need to know when a new IP is assigned? Or simply when it gets TCP/IP connectivity?
    What I really want is a way to know when a net use to a folder my router is sharing will be successful. Right now my task that does the net use is scheduled to run at system start-up and that seems to be working.

    EDIT: Actually what I have is working better than I thought. I was afraid that the net use would not persist across a router outage but it seems that is not a problem. I pulled the plug on the router for a minute and once it came up the mapped drive was still working. I guess I don't need to look for a more robust approach after all.
      My Computer


  4. Posts : 6
    Windows 7 Home Premium 64-bit SP1
       #4

    So basically, you need to know when you get network connectivity. In this thread, a user identified the events related to a network connection by disconnecting the network, connecting it back and then checking the event log. However, you can make "net use" to map a drive permanently (with the /P:Yes switch) so there is no need to re-run at startup and it should re-connect when a network is disconnected.
      My Computer


  5. Posts : 8
    Windows 7 64bit
    Thread Starter
       #5

    AdiGri, Thanks. That looks like it addresses my situation perfectly!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 03:44.
Find Us