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

bertilak

New member
Local time
3:17 PM
Messages
8
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 My Computer

At a glance

Windows 7 64bitI7
Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba
OS
Windows 7 64bit
CPU
I7
Hard Drives
600 GB
Browser
Firefox
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 My Computer

At a glance

Windows 7 Home Premium 64-bit SP1Intel Core i7 2600 @ 3.40GHz10.0 GB Dual-Channel DDR3 @ 665MHz1023MB GeForce GTX 550 Ti
Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
Windows 7 Home Premium 64-bit SP1
CPU
Intel Core i7 2600 @ 3.40GHz
Motherboard
PEGATRON CORPORATION 2AB5 (CPU 1)
Memory
10.0 GB Dual-Channel DDR3 @ 665MHz
Graphics Card(s)
1023MB GeForce GTX 550 Ti
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 My Computer

At a glance

Windows 7 64bitI7
Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba
OS
Windows 7 64bit
CPU
I7
Hard Drives
600 GB
Browser
Firefox
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 My Computer

At a glance

Windows 7 Home Premium 64-bit SP1Intel Core i7 2600 @ 3.40GHz10.0 GB Dual-Channel DDR3 @ 665MHz1023MB GeForce GTX 550 Ti
Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
Windows 7 Home Premium 64-bit SP1
CPU
Intel Core i7 2600 @ 3.40GHz
Motherboard
PEGATRON CORPORATION 2AB5 (CPU 1)
Memory
10.0 GB Dual-Channel DDR3 @ 665MHz
Graphics Card(s)
1023MB GeForce GTX 550 Ti
AdiGri, Thanks. That looks like it addresses my situation perfectly!
 

My Computer My Computer

At a glance

Windows 7 64bitI7
Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba
OS
Windows 7 64bit
CPU
I7
Hard Drives
600 GB
Browser
Firefox
Back
Top