Page 1 of 1 1
Topic Options
#169534 - 2006-10-17 06:50 PM Turning Windows Firewall off and on using Kixtart
pimpjuice Offline
Fresh Scripter

Registered: 2006-09-25
Posts: 17
Loc: Fort Lauderdale, FL
Here is my script and Im having issues trying to turn windows firewall off using kixtart. I found this online and Im trying to translate it into kixtart scripting. Can anyone help me on this issue??
To turn the firewall off change the EnableFirewall key to 0

[HKLM\System\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile]
"EnableFirewall"=dword:00000000
"DoNotAllowExceptions"=dword:00000000

To turn it back on change the key back to 1

[HKLM\System\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile]
"EnableFirewall"=dword:00000001
"DoNotAllowExceptions"=dword:00000000



THIS IS MY KIXTART SCRIPT
Color g+/n
? "Turning Windows Firewall Off"

$WindowsFW = ReadValue('HKEY_LOCAL_MACHINE\System\CurrentControlset\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\'EnableFirewall '00000001,'Version')

If $WindowsFW = 00000000
WriteValue('HKEY_LOCAL_MACHINE\System\CurrentControlset\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\'EnableFirewall '00000000,'Version')
EndIf

Top
#169535 - 2006-10-17 06:55 PM Re: Turning Windows Firewall off and on using Kixtart
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
;? " Configure Firewall Policy"
$Firewall='HKLM\SOFTWARE\Policies\Microsoft\WindowsFirewall'
$Profiles='\DomainProfile','\StandardProfile'
$SubnetList = '192.168.0.0/16,192.168.1.0/16'

for each $Profile in $Profiles
$rc = Writevalue($Firewall+$Profile,'EnableFirewall',1,REG_DWORD)

$rc = Writevalue($Firewall+$Profile+'\AuthorizedApplications','AllowUserPrefMerge',1,REG_DWORD)
$rc = Writevalue($Firewall+$Profile+'\AuthorizedApplications','Enabled',1,REG_DWORD)

$rc = Writevalue($Firewall+$Profile+'\AuthorizedApplications\List','Remote Control Server','%windir%\system32\r_server.exe:'+$SubnetList+':enabled:Remote Control Server',REG_SZ)
$rc = Writevalue($Firewall+$Profile+'\AuthorizedApplications\List','NetMeeting','%programfiles%\NetMeeting\Conf.exe:'+$SubnetList+':enabled:NetMeeting',REG_SZ)

$rc = Writevalue($Firewall+$Profile+'\IcmpSettings','AllowInboundEchoRequest',1,REG_DWORD)

$rc = Writevalue($Firewall+$Profile+'\RemoteAdminSettings','Enabled',1,REG_DWORD)
$rc = Writevalue($Firewall+$Profile+'\RemoteAdminSettings','RemoteAddresses',$Subnetlist,REG_SZ)

$rc = Writevalue($Firewall+$Profile+'\Services\FileAndPrint','Enabled',1,REG_DWORD)
$rc = Writevalue($Firewall+$Profile+'\Services\FileAndPrint','RemoteAddresses',$Subnetlist,REG_SZ)

$rc = Writevalue($Firewall+$Profile+'\Services\RemoteDesktop','Enabled',1,REG_DWORD)
$rc = Writevalue($Firewall+$Profile+'\Services\RemoteDesktop','RemoteAddresses',$Subnetlist,REG_SZ)
next

Top
#169536 - 2006-10-17 06:56 PM Re: Turning Windows Firewall off and on using Kixtart
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
also see:
http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=135401&an=0&page=8#135401

Top
#169537 - 2006-10-18 04:42 AM Re: Turning Windows Firewall off and on using Kixtart
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
And requires local admin privs.
_________________________
There are two types of vessels, submarines and targets.

Top
#169538 - 2006-10-18 04:55 AM Re: Turning Windows Firewall off and on using Kixtart
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I use GPO and it doesn't need the user to have admin rights.
Top
#169539 - 2006-10-18 05:26 AM Re: Turning Windows Firewall off and on using Kixtart
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Sure it does, but it already has them as that is what it's designed for.
Top
#169540 - 2006-10-18 05:43 AM Re: Turning Windows Firewall off and on using Kixtart
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Huh?
Top
#169541 - 2006-10-18 06:48 AM Re: Turning Windows Firewall off and on using Kixtart
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
You changed what you had posted before I think. I don't recall you having said anything about the "user".

But if not then my mistake, I certainly didn't see it before now.

Top
#169542 - 2006-10-18 06:48 PM Re: Turning Windows Firewall off and on using Kixtart
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Why isn't anybody using the code tags?

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.058 seconds in which 0.03 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org