I’m working on an auto-configure app for new PC’s. I managed to programatically set all the needed parameters, except Primary DNS Suffix of a computer (please remember that this is different from the network connection default DNS suffix).
Any help?
Update: Here’s requested class for setting IP, Subnet, Gateway, and DNS of the PC.
http://pastebin.com/fHACwwDV
It was tested only in system having 1 network interface, I don’t know how it’ll behave when there are more NICs. Oh, and it’s WIP, so for now no error handling apart from throwing exception was implemented.
From a search on msdn, looks like you’ll need to use SetComputerNameEx.
pinvoke.net spells out what you’ll need to do to access this from C#.