DNS Suffix via script / General Questions / NetSetMan Support

NetSetMan Support

Search for already answered questions about NetSetMan (Pro) or ask new ones

You are not logged in.

#1 2013-03-29 14:26

timtrace
Member
Registered: 2013-03-28
Posts: 4

DNS Suffix via script

I've been trying to control my Windows workstation's DNS suffix search list by using this line in a NSM "before" script:

reg.exe add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "SearchList" /t REG_SZ /d "domain0.com,domain1.com,domain2.com" /f

However, it does not seem to work.

If I manually execute the command from a command prompt, I'm told, "access denied."  If I run it under an elevated command prompt, success!

I'm running NSM 3.5.2.  The NSM service is installed.

Has anyone else been able to get this to work?

Offline

#2 2013-03-29 14:42

NetSetMan Support
Administrator
Registered: 2005-08-06
Posts: 1,878

Re: DNS Suffix via script

If you're running NetSetMan with the NSM Service activated then all scripts are executed with normal privileges. Unfortunately if UAC is activated those privileges don't suffice to write to the registry.
A workaround can be to deactivate NSM Service so that at every start of NetSetMan you'll get the UAC prompt again, but with it all scripts will be executed with Administrator privileges which will allow to write to the registry in the scripts.

Offline

#3 2013-03-29 15:00

timtrace
Member
Registered: 2013-03-28
Posts: 4

Re: DNS Suffix via script

Ilja Herlein wrote:

A workaround can be to deactivate NSM Service so that at every start of NetSetMan you'll get the UAC prompt again, but with it all scripts will be executed with Administrator privileges which will allow to write to the registry in the scripts.

Thank you.  I've tested and confirm that this workaround is solid.

I've seen that other NSM users have made feature requests to add DNS search suffix control via the NSM program itself.  Please add me to their number smile

Thank you, Ilja!

Last edited by timtrace (2013-03-29 15:01)

Offline