Skip to content
theDXT
  • Home
  • IT
  • Scripts
  • GitHub
  • LinkedIn
  • X (Twitter)
  • Search Icon
Swap Office 365 Licences

Swap Office 365 Licences

January 27, 2018

Update

The process detailed below has been deprecated by Microsoft. An updated version of this process is detailed in my post called Swap Microsoft 365 Licenses with Microsoft Graph.

I needed to remove some expired Office 365 licences that were expired to the point where I couldn’t do it via the admin interface so I wrote a PowerShell script to automate swapping the Office 365 licences.

You will want to run Get-MsolAccountSku this will list out the various SKUs your account has. something like this

tenant:VISIOCLIENT
tenant:PROJECTCLIENT
tenant:EXCHANGESTANDARD
tenant:O365_BUSINESS_PREMIUM
tenant:OFFICESUBSCRIPTION
tenant:PROJECTPROFESSIONAL

Just change the values in the script below to match what product you want to remove and replace it with and then run it.

$remove = "tenant:EXCHANGESTANDARD"
$add = "tenant:O365_BUSINESS_PREMIUM"

$swap = get-MSOLUser -All | where {$_.isLicensed -eq "TRUE" -and $_.Licenses.AccountSKUID -eq "$remove"}

Foreach ($User in $swap) {
Set-MsolUserLicense -UserPrincipalName $User.UserPrincipalName -RemoveLicenses "$remove" -AddLicenses $add
}
Code language: PowerShell (powershell)

That is basically it. It will just run and swap the licences.

Find files and folders

Find files and folders

January 21, 2018

Recently I needed to find all files and folders containing two spaces, normally I would use something like a file renamer but in this case for various reasons I just needed to generate a list. Eventually I ended up figuring out a PowerShell command to do it.

Here’s the code I used to do it

get-childitem -recurse | where-object {$_ -match '  '} | select-object FullName | export-csv -notypeinformation -delimiter '|' C:\file.csv
Code language: PowerShell (powershell)

The same code can be used to find anything. Just replace the two spaces with whatever you need to find.

copy files and create directories

copy files and create directories

January 19, 2018

I needed to come up with a solution to copy a directory/file to a specific location but I also needed to account for the fact that it might not be created so I needed it to also create the necessary folder structure and if the file existed I needed it to overwrite it.

This is the batch script I came up with

if not exist %appdata%\PROGRAM\settings mkdir %appdata%\PROGRAM\settings
copy "\\SERVER\SHARED\source" %appdata%\PROGRAM\settings /y
Code language: JavaScript (javascript)

Basically what the script is doing is checking C:\Users\USERNAME\AppData\Roaming\PROGRAM\settings to see if it exists if it doesn’t then it will create it. Next the script is copying the contents from the UNC path into the folder.

The way the script is currently written anything in the folder named source will get dumped into the settings folder in Roaming. If you need to copy just a specific file just add the specific file in the copy command and run it. For this solution I just set the script to be a Logon script via a GPO.

#YYCTube AGM 2017

#YYCTube AGM 2017

December 4, 2017
The Punisher Season 1

The Punisher Season 1

November 27, 2017
Teaching Premiere

Teaching Premiere

November 20, 2017
“Russian” Hackers

“Russian” Hackers

November 13, 2017
Star Trek: The Original Series

Star Trek: The Original Series

November 6, 2017
Bio Food Sensors

Bio Food Sensors

October 30, 2017
The Babysitter of BULLSHIT!

The Babysitter of BULLSHIT!

October 25, 2017

Welcome back to another episode of the Mouthy and Keerious Podcast!

This week we are talking about the (according-to-Daniel) HORRIBLE New Netflix Original: The Babysitter. #PodMom tried her best to find a “horror” movie that #DadPod hadn’t seen but failed to realize that their definition of “horror” are VERY DIFFERENT. Unfortunately for Daniel, The Babysitter is a horror comedy – his least favourite subgenre so Jill is in for an education of a lifetime after this mistake.

Bad writing & story concept, poor overall acting, ridiculous effects, and being a little bit too self aware dooms The Babysitter to being very forgettable. #PodMom tries to pitch for great “Horror Comedy” movies like Evil Dead and Cabin in the Woods, and explains her definiton of Horror vs Scary movies. #DadPod explains the difference according to him and we all come to the conclusion that Joss Whedon can really do no wrong (STAY TUNED!)

What’s your favourite Scary/Horror Movie? How do you define horror vs scary movies? Was Jill a bit too aggressive in her claim of “Everyone likes to suck Joss Whedon’s dick”?

Join us next week for our Season Finale (and explanation as to why we are doing the podcast as a seasonal release for now)

Thanks for listening! Make sure to Rate/Review/Subscribe on your favourite Podcast Platform!

Subscribe on iTunes or Google Play

Posts navigation

OLDER POSTS
NEWER POSTS

About Me

Daniel Keer

Project Lead, Senior Consultant at Digitally Accurate Inc.

Awards and Certificates
VMware vExpert ⭐⭐⭐⭐
Omnissa Tech Insider ⭐⭐⭐

Consulting

Stuck on something? Reach out to Digitally Accurate Inc. and we can provide expert IT consulting to help you move forward.

  • I’m Going to VMware Explore 2026
  • Passing VCP-VCF Architect Exam
  • Deploy Horizon Edge Gateway on VMware vSphere
  • Add Administrators to Omnissa Horizon
  • Schedule VMware Exam

Recent Posts

  • I’m Going to VMware Explore 2026
  • Passing VCP-VCF Architect Exam
  • Deploy Horizon Edge Gateway on VMware vSphere
  • Add Administrators to Omnissa Horizon
  • Schedule VMware Exam
  • Deploy Claude Desktop on Non-Persistent VDI
  • I Went to BSides Calgary 2026
  • Install Omnissa DEM Application Profiler
  • I Went to VMUG Connect Minneapolis 2026
  • Microsoft Entra ID External MFA

Tags

2014 Calgary Certificates Christmas EUC event Firewall Fix holiday How To Microsoft Microsoft 365 Mouthy & Keerious Networking Omnissa podcast Power Loss PowerShell review Script twelve days of christmas VEDA VEDA 2015 video vlog Vlog Every Day in April VMware Windows youtube yyc

© 2026   Copyright. All Rights Reserved.