Get AKS versions report using PowerShell

Hey Scripters! Today short post about gathering AKS versions report across all subscriptions in specific tenant. Kubernetes community release new version basically every 3 months. Microsoft Azure Kubernetes Service must follow all upgrades and support only 3 latest minor version of Kubernetes. It is done in following way : The current minor version that is released in AKS (N) Two previous minor versions. Each supported minor version also supports two …

Add Azure Monitor alerts using PowerShell

Hey Geeks! Today I’ve got for you PowerShell script to add Azure Monitor alerts. For people who tries to add Azure Monitor alerts using PowerShell AZ module probably now think why I prepare separate script for that. Basically in Az module is one command to do that so it’s quite easy. But what in case that requirement is to use AzureRM module? Now it’s a little bit complicated as there …

HTML report

Create HTML email report using PowerShell

Create HTML report using PowerShell. Some time ago I added a post about creating your own report. This time I wanted to show you how to create a basic system performance report and send it to your mailbox. HTML Report Below you can find PowerShell script for checking the following system details using Get-WMIObject remotely: BootUpTime UpTime C: Free space % PhysicalRAM Memory % CPU % You need to have …

disconnected sessions

Get disconnected sessions on all Domain Controllers

Get disconnected sessions on all Domain Controllers using PowerShell script. In this short article, I wanted to show you how to use Query User command to get user sessions and export final results to CSV file. Domain Controllers To get list of all Domain Controllers you need to use Get-ADDomainController command from ActiveDirectory module. Command gets one or more Active Directory domain controllers based on discoverable services criteria, search parameters …

How to gather Azure access token using PowerShell

Hey! In today’s short article I want to show you how to gather Azure access token using PowerShell. Sometime it necessary to gather information from Azure once Azure PowerShell cmdlets are not enough for things we want to do or they are very limited. If we know the body syntax of the request we can send our request to Azure REST API and in most of the cases it should …

pivot table

Create a Pivot Table in Excel using PowerShell script

Find out how to create a Pivot Table in Excel using a PowerShell script. In one of the previous articles, I described how to get computer objects from OUs. In this case, I wanted to show you how to export the same results to Excel and create Pivot Table. Pivot Table in Excel To create something in Excel using PowerShell we need to have ImportExcel module installed on our PC. …

event

Create a new Event Log using PowerShell function

Find out how to create your own event log. Recently I was asked to prepare PowerShell script for generating custom events. In this article, I want to share with you how this can be done using a simple PowerShell function. Create a new Event Log You can create event using simple command Write-EventLog. To write an event to an event log, the event log must exist on the computer and …

move computer

PowerShell Tip of the Week: Move computer objects to OU

Find out how to move computer objects to different OU. In this example, you need to have the Active Directory module installed and distingushednames of the target organizational unit and the source. Move computers PowerShell script is based on Move-ADObject command. This cmdlet moves an object or a container of objects from one container to another or from one domain to another. To move a single computer you can use …

Check Azure Kubernetes expiration date of SPN

Hello again PowerShell maniac! Today got for you special script for check Azure Kubernetes expiration date of SPN. Did you ever worked with Azure Kubernetes Service or simply Kubernetes on different platform than Azure? If not let me explain you in few words what this service is used for. If you ever worked with Docker and containers you shouldn’t have a problem with understanding of this service, as basically AKS …

lastlogondate

Get users who haven’t logged in longer than X days (LastLogonDate)

Find out how to get users who haven’t logged in longer than X days. In today’s post, I wanted to share a simple Active Directory inventory script. It is using AD module commands and saving results into a CSV file. LastLogonDate This script might be useful in getting users that haven’t logged for a longer amount of time. It is checking lastlogondate property: Please be aware that it gets a …