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 …

Check SCOM Maintenance Mode history for multiple servers

Some time ago I posted short article about how to check SCOM Maintenance Mode history for single machine. Today I would like to share with you a little bit more advanced script which helps to check multiple servers. SCOM Maintenance Mode history To get above output we need to run the script on SCOM server. Remember that not all maintenance mode history can be found there. It will show only …

Get “User Rights Assignment” security policy settings

Recently I had to check if adfssvr account is present in “Generate security audits” policy settings. As I’m working in large scale environment and mostly on server cores it was obvious that it needs to be done by script. User Rights Assignment Below you can find list of user rights. In this example we will focus on SeAuditPrivilege – Generate security audits. More info about user rights – link. To …

PowerShell Tip of the Week: Get SCOM agent version remotely

In this short article you will find out how to get SCOM agent version. You can also check one of the previous articles about Microsoft Monitoring agent where you can check how to get other useful information like SCOM group name or management server. SCOM agent version If you have admin right in Operations Manager console then you can check this directly from SCOM server: Another way is to logon …

Export command output into two columns CSV file

Recently I was looking for easy way to export output into two columns CSV file. Finding solution for this was a little bit difficult because some values of the properties were another objects or they were for example data.table types. Below you will find how to do this based on one of the ADFS module commands. Get-AdfsRelyingPartyTrust The Get-ADFSRelyingPartyTrust cmdlet retrieves the relying party trusts in the Federation Service. You …

How to find expired certificates

Hey folks, in today’s short article I will show you how in easy way check expired certificates. Script which I prepared is very easy and yes I know that it can be done in one-liner. 🙂 However I’ve decided to split it for few phases: Phase 1 – Check actual date Phase 2 – Gather all certificates Phase 3 – Filter only objects which are certificates and NotAfter attribute is …

PowerShell Tip of the Week: Get SCCM client version remotely

In Todays tip you will find out how to check SCCM client version. To get this information we will use Get-WMIObject command. SCCM client version Information about SCCM client version is located under SMS_Client class in root\ccm namespace: You can also check SCCM client version remotely on servers from txt file list: To make the output look better we can use the following script.

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 …