Script to disable ipv6 & enable File and Printer Sharing for Microsoft Networks service?
I want to disable on startup ipv6 & enable File and Printer Sharing for Microsoft Networks service in Vista Business using vbsscript through GPO. Can you help me to create it plz? Some of computers disable File and Printer Sharing for Microsoft Networks service from time to time! & ipv6 has security issues
November 20th, 2008 11:42am

Hi, You may use the following scripts to disable IPV6 and enable File sharing. I have tested the scripts on my test computers and they worked flawlessly. 1.DisableIPV6.vbs ----------------------------- If WScript.Arguments.length =0 Then Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "wscript.exe", Chr(34) & _ WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1 Dim OperationRegistry Set OperationRegistry=WScript.CreateObject("WScript.Shell") Default=OperationRegistry.RegRead("HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\") OperationRegistry.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents",-1, "REG_DWORD" Else msgbox Error End If ------------------------------ 2. EnableFS.vbs -------------------------- If WScript.Arguments.length =0 Then Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "wscript.exe", Chr(34) & _ WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1 Set objFirewall = CreateObject("HNetCfg.FwMgr") Set objPolicy = objFirewall.LocalPolicy.CurrentProfile Set colServices = objPolicy.Services Set objService = colServices.Item(0) objService.Enabled = TRUE Else msgbox Error End If --------------------------- You can then deploy the scripts via a domain based GPOs as logon scripts. Please note that we need to restart the computers after running the above scripts. In other words, these scripts will only take effect after the next startup (During the first startup, the GPOs are applied and the scripts are executed. During the second startup, the changes will take effect). For more information about the scripts, please also refer to the following webpages: VBScripts and UAC elevation http://www.winhelponline.com/articles/185/1/VBScripts-and-UAC-elevation.html Windows Firewall Scripting http://www.activexperts.com/activmonitor/windowsmanagement/scripts/networking/windowsfirewall/ Actually, with regard to the script coding issues, it is better to go to the MSDN Forums for help. MSDN Forums http://forums.microsoft.com/msdn/ Thanks!
Free Windows Admin Tool Kit Click here and download it now
November 24th, 2008 1:50pm

Hi, Does anyone know if Microsoft has any documentation that explains why to use -1 to disable all IPv6 components? I was directed to the article linked below but it doesn't list -1 as an option. http://support.microsoft.com/kb/929852 Thanks, Rob
April 21st, 2010 5:31pm

Hi, I believe: 1 in ON, 0 is off and -1 is disabled (like automatic, manual and disabled under services). 5ndr5
Free Windows Admin Tool Kit Click here and download it now
August 18th, 2010 4:33pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics