Skip to main content

Posts

Showing posts with the label Netstat

PowerShell Test Port Forwarding

Port forwarding is necessary if the device is that needs to connect to the unsecured world of the Internet.
Of course, before opening port or doing any port forwarding make sure that security is in place. Firewall rules, software configuration are properly set, up-to-date anti-virus and other settings that needs to be done to secure the system.
PowerShell can test whether a remote port is open or a Port Forwarding rules on either on the Firewall or router is set correctly.
Here’s a one liner code, to check whether the Port is open or not.
Both one line code below does the same thing, check whether the Port is open or not.
1 . New-Object System.Net.Sockets.TCPClient -ArgumentList "Remote.Public.IP.Address", 3389
2. Test-NetConnection -Port 80 -InformationLevel Detailed

Replace the port number, with any port number to be tested.
If the connected property on the displayed output is true, then the port is open.

More details on the link below: https://technet.microsoft.com/en-us/lib…

PowerShell get network adapter Speed

How to check network adapter speed installed on a computer using PowerShell?
Code snippet below will get the name of all the network adapter installed on a computer and also the speed.
To use the script on a remote computer supply the computer name and run the script with appropriate privileges to get the data on the remote computer.
#===========================
$computer_name="." $Net_adapter=gwmi-classWin32_NetworkAdapter-namespace"root\CIMV2" ` -computername$computer_name

foreach ($objItemin$Net_adapter) {
"Adapter is: "+$objItem.name +" -- "+"Adapter Speed is: "+[math]::truncate($objItem.speed/1MB) +" MB"
}
#===========================
Change the 1MB to 1GB if you need the output in GB.

Sample Output:
Adapter is: Teredo Tunneling Pseudo-Interface -- Adapter Speed is: 0 MB Adapter is: Microsoft ISATAP Adapter #3 -- Adapter Speed is: 0 MB Adapter is: VMware Virtual Ethernet Adapter for VMnet1 -- Adapter Speed is: 95 MB Adapter is:…

Show interface IP Address in Windows 10

Commands below work in Windows 10, I think it will also work in Windows 2012.

Displaying or show IP Address in Windows is quite straight forward using ipconfig /all command.
The command has the /all parameter so it will display the IP Address of all the interfaces on the machine.
Display IP Address of a specific interface in Windows via command line using “netsh” tool.
To display the interface IP Address you need to get the interface name.
Typing the command below will show all the interface name and its state whether its connected or disconnected.
 netsh interface show interface
Sample output: Admin State    State          Type             Interface Name ------------------------------------------------------------------------- Enabled        Connected      Dedicated        Ethernet Enabled        Connected      Dedicated        VMware Network Adapter VMnet1 Enabled        Connected      Dedicated        VMware Network Adapter VMnet8 Enabled        Connected      Dedicated        Wi-Fi …

Ports Replication Used by Active Directory

If replication is failing between servers in Active Directory, ports below should be checked whether they are open, block or other application is using them.

Port           135     RPC-based replication (Dynamic) TCP
LDAP       389     UDP / TCP
LDAP       636     TCP (SSL)
LDAP       3268   (Global Catalog)
Kerberos   88       UDP / TCP
DNS         53        UDP / TCP

From the list of ports the easiest one to troubleshoot is port 53, if replication is failing and at the same time users are complaining that they are not able to access websites using domain names such as facebook, twitter or youtube.

Then put DNS as top priority on troubleshooting procedures.

One good habit that Sys Ad should have is to take record every little change that has been made on the system.

Troubleshooting can be easier if there is a record for every change made.

Check out more details on this Technet links below:
https://technet.microsoft.com/en-us/library/cc772726(WS.10).aspx#w2k3tr_repup_how_huzs

https://…

Netstat to check listening ports

To check listening ports on windows, netstat is a tool that is quite handy.

And not only windows uses this tool, Linux system use this tool also. In windows to check listening ports and the application that uses the port type:

netstat -abn

The command needs to run at an elevated command prompt.

netstat -ano  is able to check listening and established ports.

Check out this link on how to open an elevated command prompt:
http://quickbytesstuff.blogspot.sg/2014/10/open-elevated-command-prompt.html

The command will list the local address the foreign address or the public ip and the state.

Example output will be like this:

[chrome.exe]
 TCP    192.168.1.50:3101    0.0.117.1:443     ESTABLISHED

In Linux this command would come handy:

netstat -tulpn

It will list the udp, tcp ports that are listening and also the daemon service listening or using the port.

Check out link below how to use netstat and Powershell to check open ports in Windows.
http://quickbytesstuff.blogspot.sg/2014/08/check-for-op…