VMware Horizon Community
Hoodsie2018
Enthusiast
Enthusiast

power-off script release IP address

I can't seem to get the power-off script to run to release the ip address of the system, per recommended steps for floating non-persistant instant-clone VMs. We have a sizable environment and dhcp pool but it's close enough we want IPs to free up automatically and not wait for DHCP aging. The scope is set to 1 hr. But often a VM gets stuck shutting down and one of the ways recommended to reduce that time is to release the IP address first. 

I'm trying to run c:\windows\system32\cscript.exe releaseIP.bat

That has in it: cmd.exe /runas:administrator ipconfig /release since it requires elevation to run the release the IP but no one is present so no one can click OK with the UAC prompt (required by IT Security), nor put in a password. 

Any idea how to accomplish this goal? 

 

Thanks!

Reply
0 Kudos
2 Replies
sjesse
Leadership
Leadership

I'd do it with a gpo instead

 

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn....

 

I did that in the past and it worked ok

 

Hoodsie2018
Enthusiast
Enthusiast

thank you. i'll give it a shot. 

Reply
0 Kudos