none
Get ipconfig all RRS feed

  • Question

  • I'm having difficulty trying to call a list of servers and obtain ipconfig all information on each server output into a csv file. Need DNS servers, Gateway, Subnet mask and IP.
    Monday, December 11, 2017 2:15 PM

Answers

  • IPCONFIG cannot be run remotely.

    The code you posted has nothing to do with IPCONFIG.

    Look in Gallery for scripts that remotely return network information.


    \_(ツ)_/

    • Marked as answer by jrvModerator Monday, December 11, 2017 3:05 PM
    Monday, December 11, 2017 2:50 PM
    Moderator

All replies

  • sorry I'm trying to get all this information via Powershell. I understand that IPCONFIG is a system utility. 
    Monday, December 11, 2017 2:38 PM
  • Please post you PowerShell script.  For pre-written scripts please look in the gallery link posted above.


    \_(ツ)_/

    Monday, December 11, 2017 2:42 PM
    Moderator
  • thank you, now when i run it all i get is my computer information. I'm needing it to call a txt file and output information to a csv please.

    [cmdletbinding()]            
    param (            
     [parameter(ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]            
        [string[]]$ComputerName = $env:computername            
    )                        
                
    begin {}            
    process {            
     foreach ($Computer in $ComputerName) {            
      if(Test-Connection -ComputerName $Computer -Count 1 -ea 0) {            
       try {            
        $Networks = Get-WmiObject Win32_NetworkAdapterConfiguration -ComputerName $Computer -EA Stop | ? {$_.IPEnabled}            
       } catch {            
            Write-Warning "Error occurred while querying $computer."            
            Continue            
       }            
       foreach ($Network in $Networks) {            
        $IPAddress  = $Network.IpAddress[0]            
        $SubnetMask  = $Network.IPSubnet[0]            
        $DefaultGateway = $Network.DefaultIPGateway            
        $DNSServers  = $Network.DNSServerSearchOrder            
        $IsDHCPEnabled = $false            
        If($network.DHCPEnabled) {            
         $IsDHCPEnabled = $true            
        }            
        $MACAddress  = $Network.MACAddress            
        $OutputObj  = New-Object -Type PSObject            
        $OutputObj | Add-Member -MemberType NoteProperty -Name ComputerName -Value $Computer.ToUpper()            
        $OutputObj | Add-Member -MemberType NoteProperty -Name IPAddress -Value $IPAddress            
        $OutputObj | Add-Member -MemberType NoteProperty -Name SubnetMask -Value $SubnetMask            
        $OutputObj | Add-Member -MemberType NoteProperty -Name Gateway -Value $DefaultGateway            
        $OutputObj | Add-Member -MemberType NoteProperty -Name IsDHCPEnabled -Value $IsDHCPEnabled            
        $OutputObj | Add-Member -MemberType NoteProperty -Name DNSServers -Value $DNSServers            
        $OutputObj | Add-Member -MemberType NoteProperty -Name MACAddress -Value $MACAddress            
        $OutputObj            
       }            
      }            
     }            
    }            
                
    end {}

    Monday, December 11, 2017 2:47 PM
  • IPCONFIG cannot be run remotely.

    The code you posted has nothing to do with IPCONFIG.

    Look in Gallery for scripts that remotely return network information.


    \_(ツ)_/

    • Marked as answer by jrvModerator Monday, December 11, 2017 3:05 PM
    Monday, December 11, 2017 2:50 PM
    Moderator
  • Thanks for the help I'll move on.
    • Marked as answer by Chicojrman123 Monday, December 11, 2017 2:55 PM
    • Unmarked as answer by jrvModerator Monday, December 11, 2017 3:05 PM
    Monday, December 11, 2017 2:55 PM
    • Edited by JS2010 Monday, December 11, 2017 9:51 PM
    Monday, December 11, 2017 9:51 PM