-
Notifications
You must be signed in to change notification settings - Fork 5
ipconfig_release_renew.ps1
Corey Watson edited this page Dec 1, 2025
·
1 revision
Release and renew IP configuration on DHCP adapters.
Releases and renews IP addresses on all DHCP-enabled network adapters, and flushes the DNS cache. Useful for resolving network connectivity issues caused by stale DHCP leases or DNS cache problems.
Provides automated network troubleshooting for common connectivity issues related to DHCP and DNS on managed Windows endpoints.
- Windows OS with network adapters
- DHCP-enabled network adapters (static IP adapters are skipped)
- Admin privileges recommended for DNS flush
- FlushDns: Whether to flush DNS cache after renewal (default: $true)
- Targets only DHCP-enabled adapters
- Releases IP before renewing
- Optionally flushes DNS cache
- Queries all network adapters for DHCP-enabled interfaces
- For each DHCP adapter: releases IP, then renews IP
- Flushes DNS cache if enabled
- Reports results for each adapter
- No secrets in logs
- Temporarily disconnects network during release/renew
- 0: Success
- 1: Failure
[ INPUT VALIDATION ]
--------------------------------------------------------------
Flush DNS : True
[ OPERATION ]
--------------------------------------------------------------
Found 2 DHCP-enabled adapter(s)
Processing adapter: Ethernet
Releasing IP address...
Renewing IP address...
Processing adapter: Wi-Fi
Releasing IP address...
Renewing IP address...
Flushing DNS cache...
[ RESULT ]
--------------------------------------------------------------
Status : Success
Adapters Updated : 2
[ SCRIPT COMPLETED ]
--------------------------------------------------------------
- v1.0.0 (2025-11-29): Initial Style A implementation
- View Script Source
- Scripts - Back to script index