Configure a DNS Forwarder on Windows Server with PowerShell

In this tutorial, I will explain how to add a DNS forwarder on Windows Server using PowerShell. The Cmdlets used in this tutorial are launched in a PowerShell window run as Administrator. To begin displaying the redirectors enter the following command: As you can see, there is already a DNS forwarder configured on server 1.1.1.1 …

Read more



GPO: Run PowerShell script at logon

In this tutorial, I will show you how to run a PowerShell script at user logon using Group Policy (GPO) in an Active Directory environment. Before you begin this tutorial, here are some considerations when running scripts at login: In this tutorial I will use a pretty simple script, it will just create an entry …

Read more



PowerShell: automatically delete files older than X days

In this tutorial, we will see how to delete files older than X day using PowerShell. This type of script is often used in businesses on servers to rotate logs. If we take the example of IIS, the logs are never deleted, which means that after 3 years, we end up with more than 1,000 …

Read more



ARR: Block PowerShell access to Exchange

In this tutorial, I will show you how to block PowerShell remote access to Exchange with ARR. As a security measure, if you use IIS ARR to publish Exchange servers to the Internet, you must block PowerShell remote access. By default, it is possible to remotely administer an Exchange server with PowerShell, we find all …

Read more



Active Directory: retrieve the base DN (distinguishedName) attribute of an object

In this tutorial, I will explain how to retrieve the base DN also called distinguishedName in an Active Directory. This attribute is often used to configure LDAP/Active Directory bindings for applications. All Active Directory objects (Users, Computers, Organizational Unit, etc.) have the attribute: distinguishedName and this is unique. I say that the base DN attribute …

Read more



Exchange 2016: Enable Extended Protection

In this tutorial, I will explain to you how to activate extended protection (Exchange Extended Protection) on Exchange 2016 (and 2019 if you do not have CU14 which automatically activates it) which will allow you to protect yourself from CVE-2024 -21410. Exchange Extended Protection is in fact an enhanced security configuration for Exchange 2016 / …

Read more



Active Directory: create an organizational unit (OU) in PowerShell

In this “How to” tutorial, we will see how to create an Organizational Unit in an Active Directory with the New-ADOrganizationalUnit cmdlet. Create an OU in PowerShell Open a PowerShell command prompt From a domain controller open a PowerShell window Use the New-ADOrganizationalUnit Cmdlet to Create the OU Enter the following command by adapting the …

Read more