Jump to content

Powershell Command - Enable-NetLldpAgent


Recommended Posts

Posted

Open Powershell and type it in.

 

If that doesn't work, try...

Import-Module netldpagent

 

and then try typing the command in again.

 

If that doesn't work, ask again.

Posted

Import-Module : The specified module 'netldpagent' was not loaded because no valid module file was found in any module

directory.

Posted
Import-Module : The specified module 'netldpagent' was not loaded because no valid module file was found in any module

directory.

 

shoud be "NetLldpAgent"

Posted

tried on Windows 10 LTSB 2016, 1809, Server 2016, Server 2019.

 

last pc i tried version of powershell was 5.1.14393.2248

 

- - - Updated - - -

 

shoud be "NetLldpAgent"

 

Same error

Posted (edited)

Need to have the following Windows features enabled/ installed:-

  • Data Center Bridging
  • DataCenterBridging LLDP Tools

Edited by HPlum78
  • Thanks 1
Posted

This should work for Windows 10...

 

If (!(Get-WindowsOptionalFeature -Online -FeatureName 'DataCenterBridging').State -eq 'Enabled') {
   Enable-WindowsOptionalFeature -Online -FeatureName 'DataCenterBridging'
}

Get-NetAdapter | Where-Object { $_.Name -like "*Ethernet*" -and $_.Status -eq 'Up' } | ForEach { Enable-NetLldpAgent -NetAdapterName $_.Name -Verbose }

  • Thanks 2
  • 1 month later...
  • 5 months later...
Posted
I haven't found much information on Enable-NetLldpAgent anywhere when looking online and i was wondering if you knew anything else about it's parameters. I'm not very proficient with powershell, but i'm hoping that NetlldpAgent can output the computer's hostname under the SysName or ChassisId instead of the Mac Address. I know that $env:computername can be used to parse the hostname, but i don't know how to feed it into the NetLldpAgent. Any idea?
Posted (edited)

So @Netvic I am going to in the first instance say that get-help is your friend here (get-help enable-netlldpagent or get-netlldpagent). But just for you here is the online documentation https://docs.microsoft.com/en-us/powershell/module/netldpagent/enable-netlldpagent?view=win10-ps or

https://docs.microsoft.com/en-us/powershell/module/netldpagent/get-netlldpagent?view=win10-ps

 

I am not 100% clear on what your after from the netlldpagent commands but get-computerinfo may help.

Edited by HPlum78

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...