PowerShell (POSH) is a a task automation command-line shell and scripting language created by Microsoft. It became part of the FOSS community in 2016 and is now available across Windows, Linux, and macOS
Restrict and report logon hours for Active Directory accounts \
For security purposes, it may be beneficial to restrict Active Directory account logins to regular working hours. These logon times can be configured using the calendar widget in Active Directory Users and Computers (ADUC). However, PowerShell provides a more efficient and flexible alternative, particularly because it offers reporting capabilities that the graphical interface does not.
Important Purview eDiscovery Changes Take Effect in May 2025 \
Microsoft is making some important changes to Purview eDiscovery from May 26, 2025. The changes affect how content searches work and are likely to affect many Microsoft 365 tenants. Administrators and eDiscovery investigators will both have to master new ways of working with eDiscovery cases, searching for information, reviewing search results, and exporting what’s found. Changes to PowerShell cmdlets might affect scripts, so there’s lots to consider.
Duplicate Mail User Objects Created for Guest Accounts \
The February 2025 EX1015484 incident explains why mail user objects with duplicate SMTP addresses are created for guest accounts. That’s a problem because Exchange Online can’t route messages to objects with duplicate email addresses. Fortunately, you can find out if any duplicates exist in your tenant with some PowerShell. Problems happen!
Install IIS and PHP 8.x on Windows 11 and Server 2025 (Core) \
PHP is still available on Windows despite Microsoft no longer providing support for version 8.x. It can be integrated as a script engine into Internet Information Services (IIS), either through the graphical IIS Manager or via PowerShell, which is especially useful for Server Core installations.
Mastering Active Directory Hygiene: Automating SIDHistory Cleanup with CleanupMonster \
Security Identifier (SID) History is a useful mechanism in Active Directory (AD) migrations. It allows users and groups in a new domain to retain access to resources that still rely on permissions from the old domain. However, once migrations are completed, these historical SIDs can become clutter, posing both security and administrative challenges.
SharePoint Online PowerShell Module Gets Modern Authentication \
Microsoft has announced that the SharePoint Online PowerShell module will be upgraded from the very old and now obsolete IDCRL protocol to use modern (OAuth) authentication in versions released from March 28, 2025. The update to OAuth should not affect scripts, but it’s alwa
Announcing Microsoft Desired State Configuration v3.0.0 \
This post announces the release of Microsoft Desired State Configuration v3.0.0. We discuss the features and benefits of DSC and how it differs from PowerShell DSC.
Microsoft Graph PowerShell SDK V2.26.1 Remains Flawed \
The developers rushed out Version 2.26.1 of the Microsoft Graph PowerShell SDK to fix some obvious issues. Alas, problems persist in PowerShell SDK cmdlets, including licensing failures and an issue that prevents the Connect-MgGraph cmdlet from being able to obtain an access token from Entra ID. My advice is to stay with V2.25 until Microsoft resolves the problems and generates a new stable version of the SDK.
Blogs, Articles, and Posts
The not so simplified syntax of Where-Object in PowerShell \
PowerShell 3.0 introduced several notable improvements to its cmdlet library, with one of the most useful features in this release being the simplified syntax for the Where-Object cmdlet. This enhancement made filtering objects more efficient and user
v7.6.0-preview.3 \
Start testing your scripts against the next gen now.
Blogs, Articles, and Posts
Terminal Chat now included in GitHub Copilot Free \
Windows Terminal Canary users can now use Terminal Chat with the GitHub Copilot Free plan! GitHub Copilot Free is limited to 50 chat messages per month. This includes the usage of Copilot in the CLI, VS Code, and Visual Studio.
Processing Multiple Message Attachments with the Microsoft Graph PowerShell SDK \
Many examples are available online to explain how to add a single attachment to messages using the Microsoft Graph PowerShell SDK. Here we look at the principles behind how to add attachments (one or many) to messages before sending them with the Send-MgUserMail cmdlet. Get the principles right and you’ll never go wrong!
Primer: Using Exchange Online PowerShell in Azure Automation Runbooks \
In this primer, we cover how to create and execute Azure Automation Exchange Online runbooks (scripts) using cmdlets from the Exchange Online management module. Some setup is necessary before runbooks can process Exchange cmdlets, but once the necessary resources and permissions are in place, it’s all plain sailing.
Custom Maester Tests: Validate Full Addresses Now and Cleaned Up Wording \
Added 3 new tests which I think the first two will be game changers. The first 2 are tests for validating locations, in which the user must have street, city, state, postal code, country, business phone, and company name the same as the valid location in the json.
[02-14-2025 MSOnline and AzureAD PowerShell modules..
Automating Code Compliance: AI-Driven Code Style Enforcement for Pull Requests \
As teams increasingly rely on automation for code quality and compliance, ensuring consistent coding standards can be challenging during the pull request (PR) process. In this article, we explore how to build an AI-powered style enforcement pipeline using modern tools like GPT-4 and CI/CD workflows.
I really appreciate your understanding for the missed edition last week. To make up for it, this week’s issue is packed with even more tips, insights, and updates to level up your PowerShell skills.
Blogs, Articles, and Posts
Final Days for the MSOnline and AzureAD PowerShell Modules \
After many twists and turns since August 2021, the MSOnline module retirement will happen in April 2025. The AzureAD module will then retire in the 3rd quarter. It's way past time to upgrade PowerShell scripts. The question is whether to use the Entra module or the Microsoft Graph PowerShell SDK. I know which option is best and say why in this article.
Automated Provisioning of Windows 365 Cloud PCs: Advanced Scripts \
We decided that we would create some more advanced scripts for admins, which would include some error handling, prompts for input, and more. You will be able to use these scripts to provision your Entra ID joined Cloud PCs for various scenarios, be it using a Microsoft Hosted network or an Azure Network Connection, Enterprise or Frontline buil
Automated Deployment of a Zero Trust Azure Automation Environment \
A common and recommended security practice is only allowing access to an Azure Storage Account via a whitelisted IP address. While this is generally a good idea, a problem arises when you need an Azure Automation Account to access one of these Storage Accounts.
PowerShell Reusable Sessions: A Guide to Persistent Remote Connections \
Learn how to leverage PowerShell reusable sessions to maintain persistent connections with remote systems. This tutorial shows you how to create, manage and effectively use PowerShell sessions for remote administration.
This is the final edition of PowerShell Weekly for 2024. Since this newsletter is hand-curated, I always take the last week of the year off to rest and reflect. I’ll return in the New Year with fresh content and my annual year-in-review, covering all the major PowerShell highlights from 2024.
Announcements!
Announcing a free GitHub Copilot for VS Code \
We're excited to announce an all new free plan for GitHub Copilot, available for everyone today in VS Code. All you need is a GitHub account. No trial. No subscription. No credit card required.
Install and integrate Microsoft AI Shell with a PowerShell module \
Microsoft’s new AI Shell integrates AI into command-line workflows, featuring the Azure OpenAI Agent and Copilot in Azure Agent for tasks like PowerShell scripting and cloud automation. You can install AI Shell (aish.exe) as a standalone app or PowerShell module to streamline coding, error resolution, and resource management on Windows, macOS, or Linux.
In the first part, we dive into The Littlest JupyterHub— an awesome tool for creating shared environments on a single server. These environments are accessible from any web browser, allowing you to create, run, and share scripts effortlessly.
Here’s what you’ll learn in the first part of the series:
An intro to JupyterHub and why it’s a game-changer for collaboration.
How to provision an Ubuntu server for The Littlest JupyterHub.
Installing and configuring The Littlest JupyterHub and support for dotnet and PowerShell.
Setting up shared environments you can start using right away.
Future videos will cover topics like setting up SSH, adding AzureAD/Entra ID authentication, connecting to external resources, securing secrets, logging, and integration with source control.
PowerShell VSCode Extension v2024.5.2-preview \
New PowerShell VSCode extension preview release v2024.5.1! This includes the breakpoint performance improvement I developed, you should see stepping through code work much faster. Please try to break this feature before release!
Blogs, Articles, and Posts
PowerShell: How to configure a custom PSSessionconfiguration \
A remote session can be set up with the help of PSSession. The predefined remote session is used by default. However, we can also create our own session configurations and then connect