Git Product home page Git Product logo

get-netview's Introduction

Build status downloads

Description

Get-NetView is a tool that collects local system and network configuration data, to streamline diagnosis of Windows networking issues.

Installation

PowerShell Gallery

To install this module from PowerShell Gallery, run:

Install-Module Get-NetView -SkipPublisherCheck -Force

It is also part of MSFT.Network.Diag, which can be installed with:

Install-Module MSFT.Network.Diag

Disconnected or air-gapped systems

If your servers are disconnected or air-gapped, use:

Save-Module Get-NetView C:\SomeFolderPath

Then move the Get-NetView folder (from C:\SomeFolderPath) to C:\Program Files\WindowsPowerShell\Modules on your target server.

Direct Execution

This script also supports direct execution:

Invoke-WebRequest "aka.ms/Get-NetView" -OutFile "Get-NetView.ps1"
.\Get-NetView.ps1 -OutputDir .\

If blocked by execution policy:

Powershell.exe -ExecutionPolicy Bypass -File  .\Get-NetView.ps1 -OutputDir .\

Usage

To begin data collection, simply run:

Get-NetView

The output is saved to Desktop\msdbg.<username>, and can be inspected with any file manager. On completion, a .zip file is created for easy sharing.

For additional help and advanced options, run:

Get-Help Get-NetView

This tool is also run automatically by Get-SDDCDiagnosticInfo.

โญ More by the Microsoft Core Networking team

Find more from the Core Networking team using the MSFTNet topic.

To see all modules from the Microsoft Core Networking team, use:

Find-Module -Tag MSFTNet

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

get-netview's People

Contributors

alvintanms avatar arudell avatar daschott avatar dcuomo avatar helmste avatar jmesser81 avatar kylecoll avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar mtfriesen avatar nevember avatar nibanks avatar omarcardona avatar rhythmshah19 avatar sayandas-msft avatar smoon193 avatar superlime avatar symbiosisstarshine avatar thasreef avatar tlukemsft avatar tmolenh avatar vikas-sangani-mvl avatar weiran-ms avatar wiconlon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

get-netview's Issues

Add Option to Control Output Type

I'm looking to onboard this to microsoft/netperf to grab state for every run, and upload it with the other logs, but when this is run there are effectively two copies of the data in the output, raw and compressed (zip). I would like two additional command line options:

  • -RawOutputOnly - which disables the compression step.
  • -CompressedOutputOnly - which deletes the raw output directory after it has been zipped.

IMPORTANT - Constrain execution to specific CPUs or CPU throttle

New execution option necessary for Azure Hosts

  • Identify a way for execution to be constrained to a selected set of CPUs. This is necessary to ensure that diagnosis does not disrupt Guest/Container workloads.

Two options:

  1. Ideally only using Host Cores for execution.
  2. Identify a way to throttle the execution such that it doesn't consume 100% CPU.

get-netview fails when we enable network debug

  1. When we enable Network Debug, Network adapter is renamed to "Local Area Connection* 1"
  2. if wild card char is observed, get-netview.ps1 fails to run.

Get-NetAdapterQos -Name "Ethernet 2" -IncludeHidden -ErrorAction SilentlyContinue | Format-List -Property *
New-Item : Illegal characters in path.
At C:\Users\Administrator\Desktop\Get-NetView.PS1:651 char:5

  • New-Item -ItemType directory -Path $dir | Out-Null
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (C:\Users\Admini...Network Adapter:String) [New-Item], ArgumentExceptio
      n
    • FullyQualifiedErrorId : CreateDirectoryArgumentError,Microsoft.PowerShell.Commands.NewItemCommand

Processing: pNic.8.Local Area Connection* 1.Microsoft Kernel Debug Network Adapter

Codepage is not valid

Hi all.
I don't know, is Get-NetView working ok with any localization of Windows desktop?
So I get the following result:
PS D:\PS> netsh advfirewall show allprofiles
????????? ??????? ??????

????????? ????????
???????? ??????????? BlockInbound,AllowOutbound
LocalFirewallRules ?/? (?????? ????????? GPO)
LocalConSecRules ?/? (?????? ????????? GPO)
and so on.

Cross-Platform Support

I know this is a pretty big ask. As I mentioned in #72, I am looking to leverage this in our netperf automation; which is cross-platform. It would be great if we could start (small) standardizing collection on Linux/Ubuntu in addition to Windows.

Add a "NonDisruptive" option to delay command execution

On Azure Hosts (or any similar live system), we to need to avoid spiking CPU for an extended duration to avoid impacting the service. -BackgroundThreads 0 option will minimize the "magnitude" of CPU usage, so the only option is to spread the CPU usage over time. Adding a delay between command executions is one way to do this.

Execution time display requires column alignment

Execution time display requires column alignment {0,6:n0} or similar.

(35 ms) Stop-NetEventSession NetRundown (31 ms) Remove-NetEventSession NetRundown
(171 ms) netsh dump
(55 ms) netsh interface ipv4 show icmpstats
(54 ms) netsh interface ipv4 show ipstats
(59 ms) netsh interface ipv4 show tcpstats
(62 ms) netsh interface ipv4 show udpstats
(57 ms) netsh interface ipv6 show ipstats
(54 ms) netsh interface ipv6 show tcpstats
(56 ms) netsh interface ipv6 show udpstats
(63 ms) netsh -?
(70 ms) netsh trace show scenarios
(11 ms) Get-ChildItem -Path C:\DELETEME\msdbg.WORKSTATION -Exclude Get-NetView.log -File -Recurse | Get-FileHash -Algorithm SHA1 | Format-Table -AutoSize | Out-String -Width 4096
(2 ms) Get-FileHash -Path "C:\DELETEME\Get-NetView.ps1" -Algorithm SHA1 | Format-List -Property * | Out-String -Width 4096

Transcript output points user to incorrect log location

Hi!

Since Start-Transcript outputs to "$OutDir\Get-NetView.log", when stopped, host output points to $OutDir. Since the log actually gets moved to "$OutDir_Logs", users aren't aware of where to go for the actual Get-NetView.log.

For potential mitigation, can think of two options:
1)
Pipe Stop-Transcript to Out-Null;
After moving the file, Write-Output your own message pointing to "$logDir\Get-NetView.log" in the try/catch blocks for Stop-Transcript.
2)
Define $logDir in the "Initialize" function instead of "Completion";
Change the Path for Start-Transcript to "$logDir\Get-NetView.log";
Remove Move-Item from the Stop-Transcript try block.

Without knowing what else could break by moving things in option #2, I'd suggestion option #1.

Line  | Code
----- | ------------------
2648  | Stop-Transcript | Out-Null
2649  | <...>
2650  | Write-Output "Transcript stopped, output file is $logDir\Get-NetView.log"

Add support for single-threaded execution

Essentially, don't use MaxThreads, or modify MaxThreads such that a value of 1, means just one thread is used instead of the current base (1) + MaxThread (1) = 2 execution threads.

Constrained Language Mode

The latest version of Get-NetView are not running on hosts that have PowerShell running in Constrained Language Mode.
So if you use Windows Defender Application Control (WDAC), formerly known as Code Integrity this will not run.
An earlier version included in SDDCDiag is running ( 2018.05.03.0m)

Would it be possible to evaluate the possibility of having Get-NetView respecting Constrained Language Mode ?

(sorry if this is the wrong place for these kind of request)

Add timeout mechanism for individual commands

To workaround: check REG setting first at the four script locations calling Get-NetAdapterStatistics

$AnyConnectKey = "HKLM:\SYSTEM\CurrentControlSet\Services\vpnagent"
if (-Not (Test-Path $AnyConnectKey))
{
if ($Global:noNetAdapters -ne $true) {
$file = "Get-NetAdapterStatistics.txt"
[String []] $cmds = "Get-NetAdapterStatistics -IncludeHidden | Sort-Object InterfaceDescription | Format-Table -Autosize | Out-String -Width $columns",
"Get-NetAdapterStatistics -IncludeHidden | Sort-Object InterfaceDescription | Format-Table -Property * -Autosize | Out-String -Width $columns"
ExecCommandsAsync -OutDir $dir -File $file -Commands $cmds
}
}

Get-VMNetworkAdapter* cmdlets not working

The Get-VMNetworkAdapter* cmdlets reference the DeviceID to try to identify the adapter, but the DeviceID only exists in the output of the Get-VMNetworkAdapter cmdlet. I submitted a PR (#69) that allows the cmdlets to correctly reference the adapters and get the required data.

Script crash in VfpExtensionDetail

Method invocation failed because [Microsoft.Management.Infrastructure.CimInstance] does not contain a method named 'GetRelated'.

At C:\Users\Administrator\Desktop\Get-NetView.PS1:1595 char:5
+     $ports = $currswitch.GetRelated("Msvm_EthernetSwitchPort", "Msvm_ ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (GetRelated:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

aka.ms/Get-NetView Doesn't Exist

image

I was just trying to migrate to calling this via aka.ms/Get-NetView and it didn't work. So I just checked and it doesn't exist, as the readme docs suggest.

No PII Mode

In many scenarios (Exchange Online servers) we need to be very careful about the kind of information that is collected. No PII should be removed from the machines by default. If we (networking teams) want to standardize around this tool, we need to make sure we don't collect stuff we shouldn't in those environments.

Get-NetView doesn't run remotely

@dl2n and the Get-SDDCDiagnosticInfo team would like to integrate Get-NetView more fully. However Get-SDDC often runs remotely and would need Get-NetView to be able to do so as well.

Fix incorrect NIC prefix

The pNIC.Hidden directory is incorrectly named. It contains Software/Virtual NICs.

Recommended changes:

  1. Refactor the directory to NIC.Hidden
  2. use swNIC for SW NICs
  3. use pNIC if it is a Physical NIC
  4. use vNIC if it's a Virtual NIC.

Avoid marking the SW NICs as vNICs. swNIC is a better naming. Specifically because they are not part of the Virtualization stack. Marking them as vNICs will be confusing to non-network folks.

Requesting sorted output file by command execution time

Hey Tom, We discussed this internally over email.
#2. Also still need a file with the time sorted output by time so we can point folks concerned about execution time to said file. And they can follow up with the relevant CMDLET owners instead of Get-NetView.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.