Day: March 29, 2019

How to Add a Replica into an Existing Availability Group using PowerShell

Overview:0. Add secondary replica to the cluster by running some commands on the availability group…

CentOS System Setup

Notes from 2018...   # Upgrade system and clean disk yum upgrade yum clean all…

HAProxy Example for SSH & OpenVNP forwarding

# Source: https://limbenjamin.com/articles/running-https-ssh-vpn-on-port-443.html   global tune.ssl.default-dh-param 2048   defaults timeout connect 5000 timeout client 50000 timeout…

HAProxy on CentOS 7

# Install HAProxy 1.8 using SCL repo yum install centos-release-scl yum install rh-haproxy18-haproxy rh-haproxy18-haproxy-syspaths  …

OpenProject Installation on CentOS 7

Docker Implementation:   # Create database on existing SQL Server (not being used) #CREATE DATABASE…

Install Fail2ban on CentOS 7 & 8

Objective: Ban all IPs that have failed logins by matching a certain policies. Here's a…

SSL Certificates with LetsEncrypt

The following configuration is for demonstration purposes, only. It is of vital importance that the…

HAProxy with Multiple SSL Certs

Method 1: --------- defaults   log 127.0.0.1 local0   option tcplog   frontend ft_test   mode http   bind…

User Accounts Management

# Method 1 # Disable account while still retain "sudo su userX"   # Block…

getDCTimeSources

$domain=(Get-ADDomain).DNSRoot $dcs=(Get-ADDomainController -Filter * -Server $domain).Hostname $dcTimeSources=@() foreach ($dc in $dcs) { #$timeSource=w32tm /query /computer:$dc…

Set File Permissions Recursively – Running on File Server

What problems does this solve? This error: "Failed to enumerate objects in the container. Access…

SQL Failover (Simple Method)

$servers="SQL01","SQL02","SQL03"; # Dynamic Credential method 1 $who = whoami if ($who.substring($who.length-2, 2) -eq "-admin"){$username=$who;} else…

Remediate IE Vulnerabilities

<# PowerShell Script to Secure Internet Explorer & Memory Operations reg add "HKLM\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_PRINT_INFO_DISCLOSURE_FIX" /v…

PowerShell: Passing Local Functions to Remote WinRM Sessions

# Dynamic Credential Method 1 $who = whoami if ($who.substring($who.length-2, 2) -eq "-a"){$username=$who;} else {$username=$who+"-admin";}…

List Folder Sizes

# Powershell Script to list folders sizes Install-Module PSFolderSize $folders = "\\FILESERVER01\SHARE01","C:\Windows\Users\kimconnect" foreach ($folder in…

List Autorun Services

# $cred = get-Credential -credential kdoan-a $Username = 'kimconnect\kim-Admin $Password = 'PASSWORD' $pass = ConvertTo-SecureString…

Last Logon Dates of List of AD Accounts

import-module activedirectory$output=""Get-Content C:\Users\kimconnect\Desktop\targetAccounts.txt | Foreach-Object -Process{ #  cast an array object as string before using…

Find Empty Directories

$directories="\\FILESERVER01\SHARE01" # Dynamic Credential method 1 $who = whoami if ($who.substring($who.length-2, 2) -eq "-admin"){$username=$who;} else…

SQL AlwayOn High Availability Default Port

Internal SQL DEV & QA environments may have SQL listening to the default port of…

PowerShell: Elevating Credential

$jumpbox="127.0.0.1" <# # Static Credentials (unsecured) $username = (Get-ADDomain).name+"\ADMINISTRATOR" $password = "PASSWORD" #> # Dynamic…