By default, PowerShell arrays are fixed size, which makes adding items more difficult than you would expect. Take the following code as an example: This generates an error: This happens …
List all Office 365 Global Administrators with Powershell
If Connect-MsolService does not work for you, then you need to follow these instructions to install the Azure Active Directory Module. If you'd like to export the list of Global Administrators to a …
Continue Reading about List all Office 365 Global Administrators with Powershell →
Remove forwarding from Office 365 Mailboxes with Powershell
It's easy to check if email is being forwarded to external or inappropriate recipients with PowerShell and remove those forwards if they are in place. First, connect to Exchange Online with the …
Continue Reading about Remove forwarding from Office 365 Mailboxes with Powershell →
How to Format a variable with leading zeros in Powershell
If you need to format a number in Powershell to include leading zeros, so that the length is always a fixed width, it is easy to do with Powershell format operator. I was working with some data that …
Continue Reading about How to Format a variable with leading zeros in Powershell →
Check if File Exists with Powershell
It's very easy to check if a file exists with Powershell and take an action if so, here are some examples: Check if a file exists Delete file if it exists An even shorter …
Continue Reading about Check if File Exists with Powershell →
How to grep with PowerShell
Unix and Linux have had the incredibly powerful grep tool for decades but windows has always been lacking. PowerShell brings the functionality of grep with the Select-String cmdlet. Use Select-String …