Here’s how to check if port is listening on a Windows Server.
Log in to the destination server.
netstat -ano | find "443" | find "LISTEN" tasklist /fi "PID eq "443" |
cloud engineer
by Ulysses
Here’s how to check if port is listening on a Windows Server.
Log in to the destination server.
netstat -ano | find "443" | find "LISTEN" tasklist /fi "PID eq "443" |
netstat -ano | find "443" | find "LISTEN" tasklist /fi "PID eq "443"
by Ulysses
Instead of the GCP Console, you can reset Windows Server password via gcloud.
gcloud compute reset-windows-password server-name \ --zone us-central1-a \ --project project-id |
gcloud compute reset-windows-password server-name \ --zone us-central1-a \ --project project-id
Username and password will generated.
by Ulysses
How to reset password of a GCP Compute Engine running on Windows OS.
gcloud compute reset-windows-password servername \ --zone us-central1-a \ --project your-project-id |
gcloud compute reset-windows-password servername \ --zone us-central1-a \ --project your-project-id
Output
This command creates an account and sets an initial password for the user [firstname_lastname] if the account does not already exist. If the account already exists, resetting the password can cause the LOSS OF ENCRYPTED DATA secured with the current password, including files and stored passwords. For more information, see: https://cloud.google.com/compute/docs/operating-systems/windows#reset Would you like to set or reset the password for [firstname_lastname] (Y/n)? y Resetting and retrieving password for [firstname_lastname] on [servername] Updated [https://www.googleapis.com/compute/v1/projects/your-project-id/zones/us-central1-a/instances/servername]. WARNING: Instance [servername] does not appear to have an external IP address, so it will not be able to accept external connections. To add an external IP address to the instance, use gcloud compute instances add-access-config. password: xxxxxxxxxxxxxxx username: firstname_lastname |
This command creates an account and sets an initial password for the user [firstname_lastname] if the account does not already exist. If the account already exists, resetting the password can cause the LOSS OF ENCRYPTED DATA secured with the current password, including files and stored passwords. For more information, see: https://cloud.google.com/compute/docs/operating-systems/windows#reset Would you like to set or reset the password for [firstname_lastname] (Y/n)? y Resetting and retrieving password for [firstname_lastname] on [servername] Updated [https://www.googleapis.com/compute/v1/projects/your-project-id/zones/us-central1-a/instances/servername]. WARNING: Instance [servername] does not appear to have an external IP address, so it will not be able to accept external connections. To add an external IP address to the instance, use gcloud compute instances add-access-config. password: xxxxxxxxxxxxxxx username: firstname_lastname
by Ulysses
Although telnet is not used regularly since insecure, it’s a handy tool for testing ports.
For example, to check if a port 80 is open, you run this command.
$ telnet servername 80 |
$ telnet servername 80
Git Bash does not come with telnet, but you can use the Windows version by using winpty.
$ winpty telnet servername 457 Connecting To servername...Could not open connection to the host, on port 457: Connect failed |
$ winpty telnet servername 457 Connecting To servername...Could not open connection to the host, on port 457: Connect failed
If port is open, you get an empty reply, just like in Windows.
by Ulysses
How to find where the executable is located in Windows? Use the where command in CMD.
where gcloud C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd |
where gcloud C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd
It will list multiple locations if you have several versions installed on your system.
by Ulysses
Here’s the command to test a network connection in Powershell.
C:> Test-NetConnection -ComputerName server -Port 443 |
C:> Test-NetConnection -ComputerName server -Port 443
Result:
ComputerName : server RemoteAddress : 10.0.0.5 RemotePort : 443 InterfaceAlias : Ethernet 0 SourceAddress : 10.1.1.34 TcpTestSucceeded : True |
ComputerName : server RemoteAddress : 10.0.0.5 RemotePort : 443 InterfaceAlias : Ethernet 0 SourceAddress : 10.1.1.34 TcpTestSucceeded : True
by Ulysses
Here’s how to add a route in Windows. Open CMD as Administrator.
route add 10.10.10.10 mask 255.255.255.0 10.10.10.254 |
route add 10.10.10.10 mask 255.255.255.0 10.10.10.254
To make it persistent, add -p.
route add 10.10.10.10 mask 255.255.255.0 10.10.10.254 |
route add 10.10.10.10 mask 255.255.255.0 10.10.10.254
To display. Specifies IP 4 only.
route print -4 |
route print -4
by Ulysses
Here’s how to find when a Windows server was last rebooted.
systeminfo | find /i "boot time" |
systeminfo | find /i "boot time"