Skip to content

Instantly share code, notes, and snippets.

@cmbaughman
Created November 7, 2016 17:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cmbaughman/e81d487291c0ad64757645fe7cdde750 to your computer and use it in GitHub Desktop.
Save cmbaughman/e81d487291c0ad64757645fe7cdde750 to your computer and use it in GitHub Desktop.
Simple Show IP Address for Windows Script Host
dim NIC1, Nic, StrIP, CompName
Set NIC1 = GetObject("winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")
For Each Nic in NIC1
if Nic.IPEnabled then
StrIP = Nic.IPAddress(i)
Set WshNetwork = WScript.CreateObject("WScript.Network")
CompName = WshNetwork.Computername
Dim WMI, Configs, Config, Adapters, Adapter
Set WMI = GetObject("winmgmts:{impersonationlevel=impersonate}root/cimv2")
' BEGIN CALLOUT A
Set Configs = WMI.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled=True")
' END CALLOUT A
For Each Config In Configs
' BEGIN CALLOUT B
Set Adapters = WMI.AssociatorsOf("Win32_NetworkAdapterConfiguration.Index=" & Config.Index, "Win32_NetworkAdapterSetting")
' END CALLOUT B
For Each Adapter In Adapters
'If Left(Adapter.Description, 14) = "Cisco AnyConnect VPN Virtual Miniport Adapter for Windows" Then
VPNIP = Config.IPAddress(0)
'End If
Next
Next
MsgBox "IP Address: "&StrIP & vbNewLine _
& "VPN IP Address: "&VPNIP & vbNewLine _
& "Computer Name: "&CompName ,4160,"IP Address and Computer Name"
wscript.quit
end if
next
@Iyhan123
Copy link

Iyhan123 commented Oct 2, 2023

Cara kontrol hp orang pakee IP gimna

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment