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 …

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 …

Resend email if Send-MailMessage returns an error

Using Send-MailMessage command is pretty simple. However there are some situations where it might cause you some problems. I recently noticed that it sometimes returns timeout error – Error in processing. The server response was: 4.7.0 Timeout waiting for client input . To fix it I created simple loop to make 5 resend attempts – it can be useful if you had to add script to a task scheduler. Send-MailMessage …

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 …

Generate patch report from WSUS

Hey scripters, today I want to share with you my script for generate patch report from WSUS. On our blog we already show you how to check if specific patch is installed on your machine. But what in case that we want to generate report for servers\workstations which are managed by WSUS? There are many of other tools which can better manage patch management process, however some environments still need …

PowerShell one-liner: Get eventlog

Use PowerShell one-liner to get eventlog details quickly and easily. In this article you will find several useful examples which will help you in daily operational tasks. Get-Eventlog The Get-EventLog cmdlet actually serves two purposes: it enables you to manage your event logs, and it also enables you to get at the events contained within those event logs. To get lognames list we just have to use parameter -list : …

Configure PowerShell remoting for Azure VMs

Hey scripters, in todays article I want to show you how to configure PowerShell remoting for Azure VMs. Recently I wanted to run the script which will check installed software on all of my Azure VMs. Unfortunately I received following error from each of the machine. I thought that it is only the problem with firewall configuration on Azure VM, so I configure additional rulles to allow connection on port …

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 …