Updated Get-IPAddress

chunking
benpturner 2018-12-07 14:25:22 +00:00
parent 9b6b60e78f
commit 090ce67080
1 changed files with 17 additions and 22 deletions

View File

@ -4,20 +4,16 @@ function Get-Ipconfig {
$array= @()
$wmi=Get-WmiObject win32_ComputerSystem
$obj=New-Object PSObject
$obj |Add-Member -MemberType NoteProperty -Name "ComputerName" $wmi.Name
$obj |Add-Member -MemberType NoteProperty -Name "IPAddress" $IP
# Finding the Network Adapter and MAC Address, DHCP Server
$wmi=Get-WmiObject win32_networkadapterconfiguration | where {$_.Ipenabled -Match "True"}
$obj |Add-Member -MemberType NoteProperty -Name "IPAddress" $wmi.IPAddress
$obj |Add-Member -MemberType NoteProperty -Name "NetworkAdapter" $wmi.description
$obj |Add-Member -MemberType NoteProperty -Name "MACAddress" $wmi.macaddress
$obj |Add-Member -MemberType NoteProperty -Name "DefaultGateway" $wmi.DefaultIPGateway
@ -33,4 +29,3 @@ echo "[+] IPConfig "
echo $array
}