PowerShell For Loop, ForEach, and Do While/Until Explained

One of the most fundamental functions in programming besides “If, Else” are loops. They allow you to process data or run a function until a certain condition is reached. In PowerShell, we can use different types of loops For loop, ForEach, Do While, and Do … Read morePowerShell For Loop, ForEach, and Do While/Until Explained

How to use Try, Catch, Finally in PowerShell

Errors in your PowerShell script can stop the execution of your script, but sometimes that is completely unnecessary. Try Catch blocks in PowerShell help you to handle those errors properly. Take the following example; You need to update the job titles of 20 employees. The … Read moreHow to use Try, Catch, Finally in PowerShell

Find Email Addresses in Office 365 with PowerShell

Sometimes you need to find the user or a mailbox that is using a particular email address. Especially aliases are sometimes hard to find, and you don’t want to open each mailbox to check if it’s using the email address that you need. You can … Read moreFind Email Addresses in Office 365 with PowerShell

Connect to Exchange Online with PowerShell

Managing Exchange Online with PowerShell makes a lot of daily tasks a lot easier (and quicker). Not only for your daily tasks you may need PowerShell, but some settings in Exchange Online can only be changed with PowerShell. So how do you connect to Exchange … Read moreConnect to Exchange Online with PowerShell

Microsoft Teams Uninstall, Reinstall, and Cleanup Guide & Scripts

Microsoft Teams is not like your average program when it comes to installing and uninstall it. The problem with Microsoft Teams is that it’s installed for every user, in the user’s AppData (or program data sometimes). Besides that, we also have Microsoft Teams machine-wide installer, … Read moreMicrosoft Teams Uninstall, Reinstall, and Cleanup Guide & Scripts

Remove Empty Folders in SharePoint Online

After merging duplicate folders in SharePoint Online I needed to remove the empty folders. This is something we can do as well with PowerShell and PnP. The script will go through all folders recursively. If the folder is empty then it will delete it. If … Read moreRemove Empty Folders in SharePoint Online

Merge Duplicate folders in SharePoint with PowerShell

A reader of this blog reached out to me if I knew a way to merge duplicate folders in SharePoint Online. Users had already worked in the duplicate folders, so we not only needed to merge the folders but also preserve the last modified file. … Read moreMerge Duplicate folders in SharePoint with PowerShell