PSDiscoveryProtocol
PSDiscoveryProtocol copied to clipboard
Different results when computer is plugged in through the phone
Half of our computers are plugged directly into the wall, while half are passed through a phone (only one jack available). When I run the invoke-discoveryprotocolcapture, with get-discoveryprotocol on a computer that is passed through a phone, I will sometimes get the phone info, and sometimes get the switch that the phone is plugged into. Is there a way to ignore the phone and always get the switch?
I got around this temporarily by doing
do { write-host "Running $($count) times" $Packet = Invoke-DiscoveryProtocolCapture -Type LLDP -ErrorAction SilentlyContinue $lldp = Get-DiscoveryProtocolData -Packet $Packet } until ($lldp.Device -notlike "Polycom*")
But ultimately, I'd like to not have to run it over and over until it isn't returning the phone.
Maybe you could add a filter here: https://github.com/lahell/PSDiscoveryProtocol/blob/3776f5814a09b2ae90357868625330b386d86c1f/PSDiscoveryProtocol/PSDiscoveryProtocol.psm1#L370
Currently only the first lldp/cdp package is returned, even if you receive multiple packages...
You could try to implement a filter there with a parameter passed as argument or you remove the Select-Object -First 1
and the all objects should be returned.
@yaroz Please use -Verbose
with Get-DiscoveryProtocolData
. The first line of verbose output will be Destination. What is the address when you get switch info and what is the address when you get phone info?
Closed because I cant test this, I need more info and it has been almost a year without an answer.
Sorry.. I must've missed the question/tag.
VERBOSE: Destination : 0180C200000E <-- switch VERBOSE: Destination : 0180C200000E <-- phone
My understanding is that frames with destination 0180C200000E should never be forwarded. The phone should drop the LLDP frame from the switch.