Change MTU size on Interface

(imported topic written by SystemAdmin)

Want to change active network interfaces to MTU size of 1278

Relevance:

q: exists keys (names of adapters whose (exists gateway of it) of network) whose (not exists value “mtu” whose (it != “1278”) of it ) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces” of registry

Acton script

regset “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces{names of keys (names of adapters whose (exists gateway of it) of network) whose (not exists value “mtu” whose (it != “1278”) of it ) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces” of registry}” “mtu”=dword:000004fe

(imported comment written by BenKus)

Hey mboseck,

What issue are you having? It looks to me like your action won’t take into accout multiple results and the syntax isn’t quite right…

Try this:

createfile until __END
Windows Registry Editor Version 5.00

{concatenation “%0d%0a” of (("%22%22 %22mtu%22=dword:000004fe") of names of keys (names of adapters whose (exists gateway of it) of network) whose (not exists value “mtu” whose (it != “1278”) of it ) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces” of registry }
__END

copy __createfile mtu.reg
waithidden regedit /s mtu.reg

I didn’t test so be careful…

Ben

(imported comment written by SystemAdmin)

Thanks Ben, will let you know the results

(imported comment written by SystemAdmin)

received the below error in the client log…

Command failed (Substitution failed while writing file) createfile until __END (fixlet 19361)

(imported comment written by jessewk)

Ben missed a parenthesis in the relevance clause. Try this:

createfile until __END

Windows Registry Editor Version 5.00

{concatenation “%0d%0a” of (("%22%22 %22mtu%22=dword:000004fe") of names of keys (names of adapters whose (exists gateway of it) of network) whose (not exists value “mtu” whose (it != “1278”) of it ) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces” of registry) }

__END

copy __createfile mtu.reg

waithidden regedit /s mtu.reg

(imported comment written by SystemAdmin)

mtu.reg file was empty… the relevance returned an empty file…

Windows Registry Editor Version 5.00

(imported comment written by jessewk)

When I run the relevance query on my machine using the relevance debugger, I get the following:

Q: concatenation “%0d%0a” of (("%22%22 %22mtu%22=dword:000004fe") of names of keys (names of adapters whose (exists gateway of it) of network) whose (not exists value “mtu” whose (it != “1278”) of it ) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces” of registry)

A:"

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces{0B70E0BF-80D6-4FA8-8664-DF6CF0D8B4B5}

" “mtu”=dword:000004fe

What do you get when you run the query in the relevance debugger on the machine in question?