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



ARR – HTTP to HTTPS redirection

In this tutorial, I will explain to you how to set up a redirection of a site from HTTP to HTTPS with ARR. If you don’t yet know IIS ARR, I’ll let you discover it in this tutorial: IIS ARR: Installation and configuration. This type of redirection is often implemented when using ARR with an …

Read more



Disable the firewall when deploying with MDT

In the Windows deployment sequence, add a Run Command Line action in the State Restore section. In the Command Line field add: netsh advfirewall set allprofiles state off



IIS ARR – configuration to use self-signed certificates on target server

In this new tutorial dedicated to IIS ARR, I will explain how to configure ARR in order to be able to use a self-signed certificate on the target server. In the previous tutorial, I explained how to do an SSL dump, in this configuration the target server is in HTTP, which means that the request …

Read more



IIS – Add the X-Forwarded-For field in the logs

In this tutorial, I will explain how to add the X-Forwarded-For field in the IIS logs, in order to retrieve the real IP address of a visitor when a reverse proxy is upstream of the IIS server. On the IIS Web server, open the Internet Services Management console. Select server 1 and click Logging 2. …

Read more



PowerShell: sign scripts

In this tutorial, I will explain how to sign your scripts. Before going into the subject, we will see why signing the scripts, the main reason is security. If your environment (computers + servers) is configured to run only signed scripts and a PowerShell script is launched in a malicious file, it will be neutralized …

Read more



PowerShell: download a file in HTTP, HTTPS

In this tutorial, I will explain how to download a file using PowerShell that is on a server accessible in HTTP or HTTPS. This can be particularly useful when administering a server without an interface, where the only browser installed is Internet Explorer or in a script. There are several solutions to download one using …

Read more