Use the Powershell command below to generate a self-signed SSL certificate on a Windows Server 2019+. Make sure you run the Powershell Window as Administrator. Step 1: Generate self-signed certificate with one CN name. The command below generates the SSL certificate and automatically imports it to the local machine certificates in this folder: “Local Computer\Personal\Certificates”.… Continue reading Generate self-signed SSL certificate on Windows Server with Powershell
Category: Powershell
Java get all enabled TLS cipher suites on Windows via Powershell
A Java installation by default supports various TLS ciphers for Java applications that use HTTPS / SSL. Some of these TLS ciphers are marked as “vulnerable” and should not be used in production environments for security. Examples of this are TLS 1.0 and TLS 1.1 ciphers, which are deemed no longer secure and should not… Continue reading Java get all enabled TLS cipher suites on Windows via Powershell
Quickly compare two CSV files with Powershell
You can use Powershell to quickly compare two CSV files, and to see which records exist in file A, but not in file B (or vice versa). We will use the two CSV files below as an example. Note: it is required that records in both files are sorted. File1.csv record1 record2 record3 record4 record5… Continue reading Quickly compare two CSV files with Powershell
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
Powershell how to get SID of AD user
You can use the following simple Powershell command to get the SID of an Active Directory user: This will give the following output: Retrieve the SID from this line: I hope this helped you!
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
Powershell get list of AD users / groups
Use the snippet below to get a list of all AD groups that a certain username is member of. Replace “[username]” with the correct username. Execute this command in a new Powershell window. Get groups of user You should get the following response: Get users in a group This command fetches all AD users in… Continue reading Powershell get list of AD users / groups
Test RPC ports via Powershell
Would you like to test whether one server can talk to another server via the (default) RPC ports? There is a very handy Powershell script that can do this. 1. Powershell script You can use the below script to verify if the network ports are opened and one machine can connect to the other one.… Continue reading Test RPC ports via Powershell
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