Use PowerShell function to check if servers are accessible

Recently I had to check quickly if all of managed servers are accessible. As SCOM monitoring wasn’t set yet in my environment I had to create simple script to do that. One of the easiest method to check if server is up is to test availability of network share. Test-Path There are many ways to check if server is accessible like for example using ping, checking some specific service but …

Get Application Pools using PowerShell function

Getting Application Pools status remotely is relatively easy. Adding them into a data table and then sending it in html formatted report is more complex process. Today I would like to show how to do this by breaking apart one of my functions. In one of the previous articles I described how to get status of application pools and additionally reset IIS if needed – link. This time we just …

Generating random password using PowerShell

Not so long time ago, I had to create a bunch of fake users for some testing purposes. Every user had to have a password set. I knew, that I could use one password for all users, but I wanted to try generating unique passwords for them. I knew we have Get-Random in PowerShell, but how to use it to generate a “random” password?

Set folder permissions on multiple servers

Set folder permissions on folder remotely using PowerShell function. Sometimes you need to give yourself full control permissions on specific path on all servers in your environment, to do this you can use below function. To display permission on specific folder using PowerShell we can use Get-ACL command. In previous article I explained about how to get permissions remotely – link. In the parameter section you can add more options …

How to find events about software uninstallation?

Recently we noticed that some software has been uninstalled on our machines. To scan all servers I created simple PowerShell function which checks event in application log. To scan events we can use Get-EventLogcommand and specify event Id – in this case it should be 1034: Script will generate output with the following information: – Server – Date – User – Application – Version – Manufacturer – Source Usage: Output: …

Get Microsoft Monitoring Agent settings remotely

Today I want to show you how to get Microsoft Monitoring Agent settings remotely using PowerShell function. This might be useful when you need to scan all servers in large scale environment to determine that configuration has been set properly. The Microsoft Monitoring Agent The Microsoft Monitoring Agent is a service used to watch and report on application and system health on a Windows computer. The Microsoft Monitoring Agent collects …

Create-Table function – working with Data Tables in PowerShell

In this article, I will share with you one of the PowerShell modules I wrote for myself which I use every day for daily tasks and in my other scripts to simplify working with data and presenting them in the script or export to CSV, Excel, etc. The module is based on .NET Framework class “System.Data”. To create and work with a table containing a data you can use a …

How to check SCOM Maintenance Mode history (version 2)?

Few months ago I added here simple script for checking SCOM maintenance mode history – link. I decided to adjust it a little bit and convert it into more advanced function. To get SCOM maintenance mode history remotely for some specific server basically we can run just this command: Usage: Function will create an object for each server and add it to $Results array. Object will contains the following properties: …

Use PowerShell function to get reboot details remotely

In this article you will find useful function which will help you get reboot details from remote machines. Script use Get-WinEvent command to find reboot related log entries. Additionally it also check last reboot time and calculate it’s up time. Script will collect following information: – BootUpTime – UpTime – RebootDate – UserName – Action – Process – Reason Write-Host command has been used for displaying “UpTime” and “BootUpTime” values …

Use PowerShell to check logical disk information remotely

Today I want to show how easily you can get information about logical disk from remote machines using PowerShell. Below function will help to gather several useful information about logical disks. You can specify disk partition as a parameter from ValidateSet: Function is based on Get-CimInstance command. However we can get basic disk information also using Get-WmiObject: Our function will get all needed information and add them into array $Results: …