Can I run ipconfig remotely and perform an ipconfig /renew on a remote
workstation

Re: IPConfig by Joseph

Joseph
Wed Jul 30 17:36:49 CDT 2003

You can do this using psexec.exe (free d/l) from www.sysinternals.com

psexec \\server ipconfig /renew

"DJL" <djlajoie@hotmail.com> wrote in message
news:Os5xYYuVDHA.1780@TK2MSFTNGP11.phx.gbl...
> Can I run ipconfig remotely and perform an ipconfig /renew on a remote
> workstation
>
>



Re: IPConfig by Gurgen

Gurgen
Wed Jul 30 17:42:31 CDT 2003

Can be used on W2k and up or on NT and down stations with WMI installed:


===========================================
remotePC = "Server"

'** To view
cl = "cmd /c ipconfig.exe>c:\temp\$$ipconfig"

'** remove comment to renew address... (not tested)
'cl = "cmd /c ipconfig.exe /renew>c:\temp\$$ipconfig"


set locator = createobject("WbemScripting.SWbemLocator")
set services = locator.connectserver(remotePC, "root/cimv2")
set process = services.get("win32_process")
process.create cl,,,pid
query="Select * From Win32_Process Where Handle='" & pid & "'"
Do
Wscript.Sleep 100
Set x=services.ExecQuery(query)
Loop while x.count > 0
sourcefile = "\\" & remotePC & "\c$\temp\$$ipconfig"
With CreateObject("Scripting.FileSystemObject").OpenTextFile(sourcefile, 1, false)
output = .ReadAll
.close
End With
msgbox "Machine: " & remotePC & vbcr & output
===========================================

Can be further expanded to set a different temp file location and it's removal at the end...


Gurgen.


"DJL" <djlajoie@hotmail.com> wrote in message news:Os5xYYuVDHA.1780@TK2MSFTNGP11.phx.gbl...
> Can I run ipconfig remotely and perform an ipconfig /renew on a remote
> workstation
>
>



Re: IPConfig by Robert

Robert
Wed Jul 30 18:01:18 CDT 2003

if you want to renew automatically at logon you can use a bat or shell.run
in vbs with the command line ipconfig /renew

But do you mean to do them all now or at logon?


"DJL" <djlajoie@hotmail.com> wrote in message
news:Os5xYYuVDHA.1780@TK2MSFTNGP11.phx.gbl...
> Can I run ipconfig remotely and perform an ipconfig /renew on a remote
> workstation
>
>



Re: IPConfig by Michael

Michael
Fri Aug 01 13:28:59 CDT 2003

DJL wrote:
> I've already have the first part of the vbscript which updates a
> remote pc's dns search list but the next part of the script I want to
> be able to renew the users pc with a ipconfig /renew silently.

Set strComputer to the value you need.

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_NetworkAdapterConfiguration where IPEnabled = true")

RenewDHCP

Sub RenewDHCP()
For Each objItem In colItems
errRenew = objItem.RenewDHCPLease
msgbox "renew called"
If errRenew = 0 Then
Wscript.Echo "DHCP lease renewed."
Else
Wscript.Echo "DHCP lease could not be renewed." & err.number &
err.description
End If
Next
End Sub

--
--

Regards,

Michael Holzemer
No email replies please - reply in newsgroup

Learn script faster by searching here
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp