Fix: “Send-MailMessage: SmtpClientAuthentication is disabled for the Tenant.” Error

Problem: When trying to send an Email from PowerShell using Microsoft 365 SMTP Server, I got this error message: Send-MailMessage : The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 Client not authenticated to send mail. Error: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is…

Read more

How to use PowerShell to Copy a Folder?

Requirement: Copy a folder using PowerShell. How to Copy a Folder using PowerShell? Copying folders in PowerShell is a common requirement for many IT professionals and system administrators. It allows them to create backups, migrate data, or simply organize files. Working with files and folders from GUI can be tedious when you…

Read more

How to Find Microsoft Teams Connected SharePoint Online Sites?

Requirement: Find all SharePoint Online sites created by Microsoft Teams. How to Find All Teams Connected SharePoint Sites? Creating a new team in Microsoft Teams creates a Microsoft 365 group and a group-connected SharePoint Online site. To get a list of all Teams connected SharePoint sites, do the following: Find Teams Connected…

Read more

PowerShell Split String: A Comprehensive Tutorial

Microsoft PowerShell is a powerful tool for automating tasks and managing systems. One of the most common tasks in PowerShell is manipulating strings. String manipulation involves various operations, such as splitting, joining, and parsing strings. In this guide, I will walk you through the process of splitting strings into arrays using PowerShell….

Read more

PowerShell Get-Date: Everything You Need to Know!

PowerShell is a powerful scripting language that allows you to automate tasks and manage your computer system efficiently. One of the most useful commands in PowerShell is Get-Date, which allows users to retrieve the current date and time, as well as perform various calculations and transformations on dates and times. In this…

Read more

SharePoint Online: Bulk Create Dummy Files using PowerShell

Requirement: For a testing exercise, We had to bulk upload 5000+ documents to a document library in SharePoint Online. PnP PowerShell to Create Dummy Files in Bulk in SharePoint Online This PowerShell script bulk uploads the given file with unique names to the root folder of a specified SharePoint Online document library….

Read more

PowerShell Aliases: A Beginner’s Guide

Typing long, complex command names over and over can reduce productivity in PowerShell. Luckily, aliases provide a simple shortcut by allowing you to create alternate short names for common commands and cmdlets. In this beginner’s guide, you’ll learn all about how to create, manage, persist, and remove aliases in PowerShell. We’ll cover…

Read more

PowerShell Out-File cmdlet: How to Redirect Output to a File?

As a PowerShell beginner, one of the most important cmdlets you need to know is Out-File. This incredibly useful cmdlet allows you to export output from PowerShell commands and scripts into text files. Whether you need to log results, generate reports, log events, or save data for later use, PowerShell has several…

Read more

PowerShell Format-Table: A Comprehensive Guide

As a PowerShell user, you may have noticed that the default output format can be difficult to read and interpret. Thankfully, PowerShell offers a powerful command – Format-Table – that allows you to format your output in a clear and concise manner. In this comprehensive guide, I will take you through the…

Read more

How to Run a Batch File from a PowerShell Script?

Batch files provide a handy way to bundle together commands, automate tasks, and execute scripts in Windows. But did you know, you can also call batch files directly from PowerShell scripts? Batch files are simple scripts that can automate a series of tasks, and when combined with PowerShell, they become a powerful…

Read more