Windows command line reference – Part02

This blog post is continuation from Part01 windows command line reference.


11. List password policy

password policy

lists password policy for the system, if system is part of domain then add domain name to command


12. Add IP address

Check for correct adapter settings before running this command

C:\netsh int ip set address “local area connection 2” static 192.168.56.101 255.255.255.0 192.168.56.1 1

netsh int ip set address “interface name” static add ip

C:\netsh int ipv4 show interfaces

list interfaces


13. Get ip from DHCP

C:\netsh int ip set address “local area connection 2” dhcp

IP from DHCP

This will request DHCP server for ip address for interface “local area connection 2”


14. Firewall rules

C:\netsh advfirewall firewall show rule name=all
(lists all firewall rules)

C:\netsh advfirewall firewall show rule name = “File and Printer Sharing (SMB-OUT”)

(listing a particular rule)

More firewall rules can be found here

Firewall rules


15. “runas” command usage

C:\runas /u:user command

Ex:
C:\runas /u:user cmd.exe

runas


16. Using netstat

UDP TCP with PID

UDP TCP PID program

repeat netstat


17. List all services associated with a process

tasklist

#notes #windows #commandline


— By Fabian Darius