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 …

KeyVault expired

Get Azure Key Vault expired secrets

Hey Scripters! If you want to gather Azure Key Vault expired secrets by the script, today is your lucky day – I’ve prepared script for that 🙂 I was searched for some easy functionality which will easily notify me about Key Vault expired secrets. The only solution I found is Events functionality in Key Vault. However after few of my test (during writing this article this option is still in …

move computer

Get Active Directory empty groups

Recently I was asked to find all Active Directory empty groups. In this case, I was using ActiveDirectory module commands with LDAP filters. Active Directory empty groups The Get-ADGroup cmdlet gets a group or performs a search to retrieve multiple groups from an Active Directory. The Identity parameter specifies the Active Directory group to get. You can identify a group by its distinguished name (DN), GUID, security identifier (SID), Security Accounts Manager (SAM) account …

Get Azure virtual machines without NSG and ASG assigned

Hi Scripters! Today I’ve got for you awesome script which will generate report with information about Azure virtual machines without NSG and ASG assigned. For non-Azure related people – Network Security Groups and Application Secuirty Groups are Azure network security concepts, which allows to filter/block virtual machines network traffic and easily group them according to ports which should be used by specific type of application. Both NSG and ASG are …

loganalytics

Add Saved Queries to Log Analytics

Hey Folks, in today’s article want to show you how to add saved queries to log analytics in all subscriptions for the same tenant. Log Analytics is a service which allows you to store all logs from all your Azure services in one place. It allows in easy way to create query useful for us and gather all information which are needed for us. In one of the article my …