Get-Process

Get process remotely including username using PowerShell

In today’s article I would like to describe how to get process remotelty used by some specific username. Most of PowerShell admins are familiar with this command but no all knows its paramter called IncludeUserName. Recently I had to check processes under some username on bunch of servers. Below you can find few helpful examples. Get process locally Get all processes for some specific user is not difficult. Paramter -IncludeUserName …

Log lines

Extract IP address from log lines using PowerShell

Recently I had to extract IP Addresses from log file and check their hostnames. The easiest way to get this was using regex pattern in Select-String command. Extract IP Address Lets says that we have a log file which contains lines like: AUDIT “2018-06-19 00:14:16.481 GMT+0200” 10.13.11.7 Server01:1812 0 0 “text=Access GRANTED cloudId=pawel.janowicz To extract IP Address from it we can use Select-String command with the following regex pattern “\d{1,3}(\.\d{1,3}){3}”>: …

Test URL on Server Core machines using PowerShell

Recently I had to test URL on server core machines. I created simple scripts to generate report with just basic information like status code and content. Below you can find short description how to check http and https URLs. Test URL For checking http URL I used Invoke-WebRequest command. Unfortunately when I run it localy on server core machine it returned me an error: Error message: The response content cannot …

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 …

ADFS_product_version

Get ADFS product version using PowerShell

In this short arcticle you’re gonna find out how to check ADFS product version on multiple remote servers. Recently I had to scan my environment for auditing purpose. One of the tasks was to compare ADFS service product version. ADFS product version To check it on single machine we can use Get-Item cmdlet: It getting a little bit more complicated if you have plenty of severs and they are Server …

How to create dump files remotely (ProcDump) using PowerShell?

Recently I had to create memory dump files for multiple remote servers. I found great tool called ProcDump on Microsoft page which can do it. Unfortunately it can’t be run remotely so I had to combine this tool features with PowerShell commands. ProcDump ProcDump is a command-line utility whose primary purpose is monitoring an application for CPU spikes and generating crash dumps during a spike that an administrator or developer …

free disk space

Get free disk space from remote computers

One of the things that you have to monitor in your environment is free disk space. In this short article I want to share with you some code lines which help to create disk report. Free disk space Script is based on Get-WmiObject cmdlet which gets instances of Windows Management Instrumentation (WMI) classes or information about the available WMI classes. For more information please refer to Microsoft docs page. Script …

How to add progress bar in your PowerShell scripts?

Today you will learn how to add progress bar in your code. In last post I described how to combine CSV files and this time I’m gonna show how to use those files and add cool feature to script. Progress bar Script is based on Write-Progress cmdlet which displays a progress bar in a Windows PowerShell command window that depicts the status of a running command or script. You can …

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 …

Get cluster html formatted report using PowerShell

Getting cluster information is pretty simple, however its becoming a little more complicated when you want to get this remotely. In one of the previous articles I have written about getting cluster data remotely. Today I would like to share with you one of my newest script for creating cluster report. Final results will be send to email in nice formatted html table: Get cluster report I found some great …