The snippet below is directly from the Portable Script Center. Works great
locally and as a login script (removing the echo's of course).
My question is what is the point of the strComputer = "." line? Or rather
the "." on that line. I know the "." indicates the local PC, but I've been
under the impression that you could enter a remote machines name (on the same
network) instead of the period, and the script would apply to that remote
machine. However, it doesn't work that way. I've tried other scripts like
the reboot script that don't work either. If all the script apply to the
local machine anyway, why do we need the strComputer = "." line?
Can anyone update me as I appear to be misinformed?
---------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each objNetAdapter In colNetAdapters
errEnable = objNetAdapter.EnableDHCP()
Next
--------------
Thanks for any help or suggestions!
-Steve