On Windows 7, to add new firewall rules, or to modify the rules.

To add a new firewall rule:

netsh advfirewall firewall add  rule name="rdp-miles" dir=in localport=3389 action=allow remoteip=192.168.1.123,123.234.45.67/32 protocol=tcp

To alter the firewall rule:

netsh advfirewall firewall set  rule name="rdp-miles" new remoteip=192.168.1.0/24,123.234.45.67/32

To show the firewall rule

netsh advfirewall firewall show rule name="rdp-miles"