Event ID's

PowerShell Tip of the Week: Query multiple event ID’s remotely

In my daily work I often need to look for specific event ID’s on all computers. As my environmnet contains mostly server core machines I always use PowerShell script for checking that. Multiple event ID’s Get-WinEvent cmdlet gets events from event logs, including classic logs, such as the System and Application logs, and the event logs that are generated by the Windows Event Log technology.┬á It also allows you to …

Test multiple ports on remote servers using PowerShell script

Some time ago I added articles about testing connection on several ports. In one of them I was explaining how to format PortQry results and other was about PowerShell function. This time I wanted to speed up things a little bit ­čÖé Testing connection We can test connection in several ways. In this case I wanted to make a test on lots of remote machines in fast way. In this …

Get Azure logs using PowerShell script

Today I wanted to show you one of the method for getting Azure logs. In this case I was looking for information about start and stop action. Azure logs To connect to Azure resources and be able to check logs you need few things: Azure Credentials Environment TenantID Subscription Resource Group Name Below you can find example for converting your password to secure string and adding it with account ID …

PowerShell Tip of the Week: SQL Server Native Client version

Recently I had to extract SQL Server Native Client version from all of my SQL machines. I would like to share simple script for extracting that information remotely from registry. SQL Server Native Client´╗┐ To find version using PowerShell we need to know where is it located. Easiest way for me was extracting this from registry: SQL Server 2008/2008 R2:– HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLNCLI10\CurrentVersion SQL Server 2012/2016:– HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLNCLI11\CurrentVersion You …

PowerShell Tip of the Week: Restart Web Application remotely

In todays short article I want to share few simple one-liner scripts that I’m using for Web Applications. They might be useful for your daily administration and if you want to create automated reports. Web Application pool I often need to check application pools status and depends on the output perform some actions. To use examples from this article you need WebAdministration module commands. Below you can find how to …

events

Extract dates from string and convert it to UTC

Today I want to show you how to extract dates from string. Recently I posted article about getting IP address from log file. This time its a little bit more compliacted as date format in string is invalid. Extract date from string Extracting dates from string is pretty simple if you know the regex pattern. In my case I had to get all dates from string and use it as …

lockout source

Get lockout source for currently locked users

Todays articile is about getting lockout source and checking who is currently locked in your environment. Script is based on ActiveDirectory module and Get-WinEvent commands. Currently locked users First we need to check how many users are locked. Below you can find simple script for checking that. Script is using Search-ADAccount command with LockedOut parameter. Find lockout source Next part is to find lockout source for each users. To do …

SCOM UR

Installing SCOM UR patch on remote computers

In this short articile you will find out how to install SCOM UR patch remotely. In one of the previous articile you can check also how to get information about UR version from remote machines. Installing SCOM UR Below you can find simple example for installing patch 2012 R2 UR14: In my case patch with .msp extension was located on d: drive: First script will create folder d:\temp on remote …

SCOM

End SCOM maintenance mode on multiple servers

Today I would like to share with you a one of SCOM scripts which I use on regular basis. Some of you are working in large scale environment and have to put large amount of servers in SCOM maintenance mode. In this article you will find out how to stop it for some specific machines. End SCOM maintenance mode In one of the previous articles I was describing how to …

remove

Remove user from specific AD groups using PowerShell

If you are looking for simple AD group member removal script this article is for you. Today I want to share few examples about getting group membership and removing one specific user from multiple groups. I was using commands form ActiveDirectory module. Get user group membership Below you can find several commands which helps to get user direct group mmebership: Remove user group membership Removing user from specific group is …