PSDiscoveryProtocol icon indicating copy to clipboard operation
PSDiscoveryProtocol copied to clipboard

Different results when computer is plugged in through the phone

Open yaroz opened this issue 2 years ago • 3 comments

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?

yaroz avatar Feb 11 '22 18:02 yaroz

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.

yaroz avatar Feb 11 '22 19:02 yaroz

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.

BornToBeRoot avatar Feb 11 '22 20:02 BornToBeRoot

@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?

lahell avatar Feb 15 '22 14:02 lahell

Closed because I cant test this, I need more info and it has been almost a year without an answer.

lahell avatar Jan 25 '23 18:01 lahell

Sorry.. I must've missed the question/tag.

VERBOSE: Destination : 0180C200000E <-- switch VERBOSE: Destination : 0180C200000E <-- phone

yaroz avatar Jan 25 '23 19:01 yaroz

My understanding is that frames with destination 0180C200000E should never be forwarded. The phone should drop the LLDP frame from the switch.

lahell avatar Jan 26 '23 21:01 lahell