Messing with Windows Firewall

I often work remotely.  Its a prereq of travel.  It seems that no matter how far I travel my work always finds me and asks me to help resolve some computer problem. 
 
While I was working in Bangkok I wrote a script which will remotely install VNC onto workstations, allowing me to remotely access any workstation on demand.  This works great in most instances except when the user has the Windows Firewall installed.
 
Now all was not lost.  As long as the "File and Print" shareing has been enabled we have ways to remotely enable / disable / or add exceptions to the Windows Firewall remotely.  Here’s how you do it:
 
You will need the PSTools Suite from Microsoft Systernals.  The PSEXEC program allows you to remotely execute commands on a remote PC. 
 
Disable Windows Firewall
psexec \\computername netsh firewall set opmode enable
 
Add a port for VNC
psexec \\computername netsh firewall add portopening TCP 5900 VNC enable subnet
 
 
Advertisements

About jasontarby

Enterprise Architect / Network Engineer at SRA International, Inc.
This entry was posted in Computers and Internet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s