Category Archives: Powershell

Powershell computer enum

Here is a short powershell snippet that will dump out all the computers in a domain into a csv file with operating system versions they are running: Get-ADcomputer -SearchBase “DC=servers,DC=domain,DC=com” -filter ‘samaccountname -like “*”‘ -properties OperatingSystem,OperatingSystemHotfix,OperatingSystemServicePack,OperatingSystemVersion,PasswordLastSet | export-csv out.csv

Posted in Powershell | Leave a comment

Script to list all members of Office 365 Admin Roles

Here is a short script to enumerate the Office 365 Admin Roles and list out each of their memberships. Please note, for this to work you need to install the Azure AD Powershell module. Connect-MsolService $roles = Get-MsolRole foreach ($role … Continue reading

Posted in Powershell | Leave a comment

Powershell script to show duplicate tv episodes

This powershell script will look in my recorded tv folder for my media center pc and count the number of episodes displaying any duplicates: $sh = new-object -com shell.application $hash = $null $hash = @{} $folder = $sh.namespace(“F:\Recorded TV”) if … Continue reading

Posted in Powershell | Leave a comment