Giter Club home page Giter Club logo

get-switchport's Introduction

Get-SwitchPort.ps1

SYNOPSIS

Script to correlate hostnames in a text file to their switch port/VLAN for each. Script can also generate results for the local machine only.

REQUIRED MODULES

PSDiscoveryProtocol

PSLogging

SYNTAX

  ./Get-SwitchPort.ps1 [-local] [[-path] <String>] [[-name] <String>] [[-logSuffix] <String>] [<CommonParameters>]

DESCRIPTION

PARAMETERS

-local <SwitchParameter>

OPTIONAL: Switch to denote whether script should run only on local machine

Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Accept wildcard characters?  false

-path <String>

REQUIRED: Location of file containing hostnames (one per line)

Required?                    false
Position?                    1
Default value                [Environment]::GetFolderPath("Desktop")
Accept pipeline input?       false
Accept wildcard characters?  false

-name <String>

REQUIRED: Name of the input file at above location

Required?                    false
Position?                    2
Default value                computers.txt
Accept pipeline input?       false
Accept wildcard characters?  false

-logSuffix <String>

OPTIONAL: Can be used to add a suffix to the log file name

Required?                    false
Position?                    3
Default value
Accept pipeline input?       false
Accept wildcard characters?  false

OUTPUTS

Log/output stored in C:\Windows\Temp<name>.log

Purpose/Change: Add support for multiple NICs

EXAMPLES

EXAMPLE 1

# Call script with hostname file stored on Bob's Desktop

PS C:\Users\Bob\Desktop\Scripts> ./Get-SwitchPort_1.3.23.ps1 -path ../ -name servers.txt -LogSuffix _servers

EXAMPLE 2

# Call script with local machine only

PS C:\Users\Bob\Desktop\Scripts> ./Get-SwitchPort_1.3.23.ps1 -local -LogSuffix _LocalTest
    

    Directory: C:\temp
    

    Mode                 LastWriteTime         Length Name                                    
    ----                 -------------         ------ ----                                    
    -a----          1/3/2023   2:02 PM              0 Get-SwitchPort.log

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.