Send email via Powershell

If you want to send an email via Powershell, e.g. to test if a local SMTP server is able to receive incoming email, you can use the following Powershell command: Replace the example values in the command above to the credentials used in your situation: -SmtpServer Servername (DNS) or IP address of the server which… Continue reading Send email via Powershell

Published
Categorized as Powershell

Powershell export and import installed Windows Server roles and features

You can use the Powershell snippet below to simply export all installed Windows Server Roles and features from a Windows 2019 Server. You can save the roles in a CSV files, and with the second command you are able to automatically install all the exported roles and features to another Windows Server. This is an… Continue reading Powershell export and import installed Windows Server roles and features

How to check ADLDS replication status with custom host/port

If you want to check the replication status of an ADLDS (Active Directory Lightweight Directory Services) instance, you can use the command repadmin. By default all commands issued to repadmin will use the default LDAP ports (389/636). If your ADLDS instance uses different ports, you can add a parameter to the repadmin command. 1. Check… Continue reading How to check ADLDS replication status with custom host/port

Powershell check if an AD Group Managed Service account (GMSA) is correctly installed on Windows Server

If you wish to check if a Windows Group Managed Service Account (GMSA) is correctly installed (and available for use) on a Windows machine, you can do the following. Open a new Powershell Window First make sure that the Active Directory Powershell feature is enabled on the server. Do this by issuing this command: Afterwards,… Continue reading Powershell check if an AD Group Managed Service account (GMSA) is correctly installed on Windows Server

Powershell how to automate Windows Server Backup tasks

If you would like to automate your Windows Server Backup workflows, you can use the following Powershell snippet. 1. Install Windows feature (if not already installed) Firstly check if the Windows Server Backup feature is installed on the Windows Server machine. The easiest way is to execute the following statement in a Powershell Window which… Continue reading Powershell how to automate Windows Server Backup tasks

Published
Categorized as Powershell

Powershell copy files from directory excluding certain extensions

In Powershell you can use the pipe symbol “|” to chain certain commands together. This enables you to make powerful scripts. One example how you can use this is to recursively copy files from one location to another, but exclude certain files based on the filename or extension. Example 1: copy all files from one… Continue reading Powershell copy files from directory excluding certain extensions