Get Computer Name from Azure Device ID

We have multiple RRAS servers, and occasionally, I need to locate which one a client is connected to for troubleshooting. Now the RRAS console has some inconsistencies, sometimes it displays the computer name, sometime the Azure Device ID (Not the object ID) The Microsoft Docs on the Get-AzureADDevice is woefully incomplete, and it took me … Read more

Domain Replication Health

I have been doing a fair amount of work upgrading/removing/building domain controllers for a client, and wanted an easy way to check replication health and topology, and came up with this script. It has a GUI and allows for export of results to CSV This requires powershell remoting to be enabled, and a powershell version … Read more

Check language in Media Files

I have a largish media collection (mainly ripped DVDs) but noticed that somehow, I had managed to rip foreign audio instead of English. A little script can help identify these easily with the help of the PowerShell module “Get-MediaInfo” (The script will install this for you providing the first run is from an elevated PowerShell … Read more

PowerShell Script to check if certain Azure AD users are in certain Azure AD groups

A bit of a mouthful that heading! Basically, we use Azure AD groups to manage certain aspects of our MEM deployment. The script requires the AzureAD module (It will check for and prompt you to install it if you run the script as Admin) and a csv file with the users UPNs in a column … Read more

Log On hours with powershell

We had a requirement recently to set logon hours for a specific set of users. To achieve this, we set up one user through the AD User and computers snap-in: Simply run the script, input the username of the user you have already configured logon hours for, then when prompted, enter the group name you … Read more

Powershell GEOIP Lookup using IPWhois.io

Sometimes, you want to look at a bunch of IPs and figure out where they are coming from. It could be firewall logs, maybe some web host logs. This script was originally developed for a very specific use case, it takes a bunch of IPs in a CSV (with a column header of ‘IP’) and … Read more

Office 365 – Report on Shared Mailboxes

A quick one-liner, which pulls back a list of shared mailboxes, last logon time, size in MB and item count. Connect to your EXO with connect-exchangeonline then run the below (This can take a while of you have a large amount of shared mailboxes) Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | get-mailboxstatistics | select displayname,lastlogon*,@{name=”TotalItemSize (MB)”; expression={[math]::Round(($_.TotalItemSize.ToString().Split(“(“)[1].Split(” … Read more

AWS Workspaces – Clean up orphaned Managed AD objects

If you manage a large number of AWS workspaces, chances are you will end up with orphaned computer AD objects cluttering up your domain. This script pulls a list of workspaces, compares it to the list of machines in AWS managed AD and removes any AD computer object without a corresponding workspace. This script requires … Read more