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 …

Get list of Domain Controllers from your domain

Today I would like to show you how to prepare Domain Controllers report using Data Table. To get all DC’s we will use ActiveDirectory module. Basically you can get list of all Domain Controllers from your domain using just two commands: In this example I wanted to show you how to create Data Table and send results to your email in formatted HTML table. Script apart from gathering DC’s properties …

Check secure channel on multiple servers

Checking secure channel on all machines might be time consuming, especially in large scale environments. Today I will show you how to get that information easily using PowerShell function and additionally check IP addresses. To get information about secure channel I used the following nltest command: Usage: You can display results in console, pop-up window or save it to CSV file: Final script: Check how to test connection on several …

How to create your first Powershell GUI Tool

If you ever thought about creating your first PowerShell GUI tool, this article might be helpful for you. In this post you can find how to create simple tool for basic domain controller troubleshooting. At the end our tool should look like this: Below you can see how such GUI Tool is build using “System Windows Forms”. You can use it as a template for other purposes: On the beginning …

Using PowerShell to perform DC health checks (DCDIAG, REPADMIN)

Below you can find another great and useful PowerShell function for checking DC health (DCDIAG, Repadmin) remotely. There are several commands known for basic Domain Controller troubleshooting. In this function we focused on DCDIAG and Repadmin as they are used probably in every situation. On the beginning of script I added try/catch to check if server exist and then test connectivity. For DCDIAG part I used some lines from “Active …

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 …