PowerShell Tip of the Week: Get IP address

There are multiple ways to get IP address information. Most common are ipconfig or Get-NetIPAddress command. Today I want to show you how to check this quickly using ping class. Get IP address To check IP configuration we can use one of the following one-liner commands Our script is based on .NET Framework System.Net.NetworkInformation ping class: Output: Results will be displayed in console and at the end saved into CSV …

Use PowerShell to format port query (PortQry) output

Recently I had to check connectivity to several servers on some specific ports using PortQry. As some of you already know this command will return some kind of the connectivity test report. I wanted to convert this into nice formatted table. Port Query Port Query – Display the status of TCP and UDP ports, troubleshoot TCP/IP connectivity and security, return LDAP base query info, SMTP, POP3, IMAP4 status, enumerate SQL …

Configure PowerShell remoting for Azure VMs

Hey scripters, in todays article I want to show you how to configure PowerShell remoting for Azure VMs. Recently I wanted to run the script which will check installed software on all of my Azure VMs. Unfortunately I received following error from each of the machine. I thought that it is only the problem with firewall configuration on Azure VM, so I configure additional rulles to allow connection on port …

PowerShell one-liner: Test connectivity

In this one-liner series I would like to show you several ways to test connectivity. There are lots of methods and basic commands to check network connection like ping, telnet, tracert etc. However it this post you will find out how to combine other PowerShell commands into one-liner script. Most common PowerShell command is Test-Connection which returns basically the same output as Ping. To use it for a bunch of …

How to check password for WiFi networks?

In this article I want to show you how to check password for WiFi networks. In big companies there is often situation that some guest want to connect to network in office but nobody knows what is the password. WiFi network profile is always saved on your computer, so there is no problem to gahter all information about it. Script using netsh command to scan for all WiFi networks cached …

Test connection to servers on several ports

Below you can find simple function to test connection on several ports. Sometimes you had to check connectivity in your environment to all servers. This script will make it easy for you. Script use Test-NetConnection command which allows to specify port number for checking: For more information about this command please refer to technet site. Usage: Output: Final script:

PowerShell function – check failed ping status (Request timed out)

There was often situation where I had to ping some server for specific time. This is why I created Get-Ping function where you can specify for how many minutes server will be pinged. At the end you will have full results in pop-up window. In this function I just used simple ping command where I’ve searched lines with status names: One of function parameters is $Minutes. It will be used …

Check firewall rules remotely using PowerShell

In past few days I had to check firewall rules setting on several machines. It was a good opportunity to write PowerShell function for this and share it with you. It’s just another simple function which will help you to gather the following firewall information from servers remotely: – Server – Direction – Action – Rule Name – Profile – Enabled – Protocol – Local Ports Below you can find …

Scanning XML file from internet – O365 Products

Recently I worked on script for checking if IP address found in ADFS dedicated load balancer logs matches the Office 365 products IP address ranges/subntes. List of products and IP address can be found on office support page and to make things easier XML file is also provided – link. For checking if IP address exists within subnet I let myself use the script from internet: http://www.gi-architects.co.uk/2016/02/powershell-check-if-ip-or-subnet-matchesfits/ We have script …

Testing connection to secure channel ( Test-NetConnection )

I recently worked on script which gather all needed information for basic DC troubleshooting. One of the steps is to test netconnection to secure channel from affected Domain Controller on following ports: 88, 135, 139, 389, 464, 636, 3268, 3269. First thing is to find out which secure channel is currently set on this DC. To do this I used the following nltest command: nltest.exe /sc_query:yourdomain.com PS C:\windows\system32> nltest.exe /sc_query:yourdomain.com …