Get domain role and PC type from remote computers

Today I want to show how to get domain role and PC type using PowerShell function. You can get this information easily using 1 liner script but results will be presented as numbers. Domain role and PC type Function is based on Get-WmiObject command and it query Win32_computersystem class. To get “PC type” and “Domain Role” using just one command we have to use Select-Object cmdlet after the pipeline: Unfortunelty …

Basic DC health email report via PowerShell

Today I would like to share one of the scripts for basic DC health checks. Some time ago I added article about DCDIAG and Repadmin. This time I created html formatted report for DCDIAG, ADSystem and AD Services. You can modify this easily and add additional functions. DC Health report Script contains lots of lines so we need to break it apart to make it more understandable. For health checks …

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. Please also check out one of the latest article for creating basic DC health email report. DC health checks 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 …

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 …