Newbie needs help setting WINS entries

Welcome Forums General PowerShell Q&A Newbie needs help setting WINS entries

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years ago.

  • Author
  • #6444

    Points: 0
    Rank: Member

    by Upinit at 2012-12-03 16:23:56

    I'm not well versed with Powershell and need some assistance. I have a small script I would like to use that will set the IP, subnet mask, default gateway, DNS, and WINS on NIC. I googled and found examples and everyhting is working except the WINS part. I am receiving a Return Value of 68 instead of a 0 for just the WINS portion.

    Here is my script:

    $ip = read-host "Enter the IP address of the server"
    $gateway = read-host "Enter the Gateway of the server"
    $wmi = get-wmiobject win32_networkadapterconfiguration -filter "ipenabled = 'true'"

    Can someone direct me to a potential solution?


    by Upinit at 2012-12-03 20:14:44

    I found the solution, you have to supply a second WINS address for some reason so I supplied a null entry.


    by Klaas at 2012-12-04 00:58:26

    I think that's because there are 2 properties: WINSPrimaryServer and WINSSecondaryServer that both will be set with the SetWINSServer method. This is different from the DNSServerSearchOrder which is a collection to which you can submit 1,2,or more IPs.

    by RichardSiddaway at 2012-12-04 08:52:37

    Documentation on the SetWinsServer() method is here ... 24(v=vs.85).aspx

The topic ‘Newbie needs help setting WINS entries’ is closed to new replies.