Enabling NetBIOS vias powershell script

Welcome Forums General PowerShell Q&A Enabling NetBIOS vias powershell script

Viewing 1 reply thread
  • Author
    Posts
    • #195836
      Participant
      Topics: 1
      Replies: 0
      Points: -8
      Rank: Member

      I want to write a script that enables NetBIOS on an adapter. SO I can run this as a schedule task once a month. I have searched te articles and forums and have found how to get properties of the adapter, but not how to set the NetBIOS property to enabled. I am very new to powershell so this is indeed a newbie question.

    • #195857
      Moderator
      Topics: 3
      Replies: 167
      Points: 878
      Helping Hand
      Rank: Major Contributor

      Hello,

      As far as I know, there is no direct CmdLet to enable or disable the 'NetBIOS over TCP/IP' on a NIC, so you can use CIM classes/methods to achieve the same...

      # List the available network adapters,
      # and get the interface index of a nic to which you want enable the NetBIOS
      Get-NetAdapter
      
      # Get the adapter using CIM instance
      $Adapter = Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration -Filter "InterfaceIndex = 14"
      
      # Invoke the method to enable the NetBIOS on the same adapter
      # Default = 0, Enable = 1, Disable = 2
      Invoke-CimMethod -InputObject $Adapter -MethodName SetTcpipNetbios -Arguments @{TcpipNetbiosOptions = 1}
      

      Since you mentioned that you are a newbie, please do some basic PowerShell trainings to get familiar with various CmdLets and techniques before you actually jump in writing the scripts.

      Thank you.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.