Blog

PowerShell: check whether the current user is a member of Domain Admins

# short snippet to check whether the currently login user is a domain admin$CurrentUser =…

Office 365 Active Directory Hybrid Accounts Administration

Intro This scenario assumes that Azure AD Sync has been used to synchronize on premise…

PowerShell: Script to Stop, Start, Disable, and Enable Exchange Server

<#This script contains a set of functions to administer Exchange 2010, 2013, 2016, and 3000.…

PowerShell: Add Office365 Records on DNS Servers

Make Changes to Internal DNS A. Delete Old CNAMES and MX Records Sample commands from…

Linux: Reclaim Disk Space by Performing System Cleanups

All systems: Check disk space usage # check /var directorydu -a /var | sort -nr…

PowerShell: Raise Domain Forest Functional Level

# Raise Forest Functional Level$forest=Get-ADForest# 2012R2 LevelSet-ADForestMode -Identity $forest -Server $forest.SchemaMaster -ForestMode Windows2012R2Forest -Force# 2016…

PowerShell: Demote Domain Controllers

$computername=$env:computername $localAdminPassword='PASSWORD' function demoteDc($computername=$env:computername,$localAdminPassword){ $erroractionpreference=stop $encryptedPass=convertto-securestring $localAdminPassword -asplaintext -force Import-Module ActiveDirectory $thisComputer=$env:computername $fsmoRoles=Get-ADDomainController -Filter *|Select-Object…

PowerShell: Microsoft Exchange Active Directory Integration

Assuming that Exchange is already set and in production, it's often advisable to record its…

Docker: Update Startup Policy for Running Containers

# Update only 1 container by name (instead of ID)docker update --restart=always kimconnect # View…

PowerShell: DHCP Server Scope Options Editing

Occasionally, internal DNS server changes as machines are refreshed and/or decommissioned. DHCP servers should also…

PowerShell: Install TightVNC on Windows via CLI

Install VNC Server on the Remote Windows: # Access Remote Server via WinRM$SHERVERNAME = "SHERVER007"$winRMHttp=5985$winRMHttps=5986#…

Repair Windows Server 2016 Error 0x800f081f

Run this function in PowerShell as Administrator: function resetWindowsUpdate{ # Source: https://learn.microsoft.com/en-us/troubleshoot/windows-client/installing-updates-features-roles/additional-resources-for-windows-update write-host 'Resetting Windows…

PowerShell: Set DNS Servers on Localhost

Display the current DNS Server Entries PS C:\Users\KimConnect> Get-DnsClientServerAddressInterfaceAlias Interface Address ServerAddressesIndex Family-------------- --------- -------…

Windows 2016 Cumulative Roll-up Install

Use this method to apply cumulative roll-ups that would not successfully apply via Automatic Updates:…

PowerShell: DHCP Server Migration

Nowadays, being lazy is good. Why waste energy with clicking buttons when there are a…

PowerShell: Resolve “CredSSP encryption oracle remediation” Error on Windows 2016

Error message: An authentication error has occurred. The function requested is not supported. Remote computer:…

PowerShell: Enabling and Disabling Network Level Authentication (NLA)

NLA is Microsoft's answer to mitigate some DDoS attacks via remote desktop (RDP). It uses…

PowerShell: 1-Liner to Discover SQL Servers on the Network

Run this command on server with SQL CLI installed (this will only detect SQL servers…

AWS-CLI: Detach A Volume

Check Volume's Status PS C:\Windows> aws ec2 describe-volumes --region us-west-1 --volume-ids vol-0a0f16ef5a9d69a29{ "Volumes": [ {…

Install AWS Command Line Interface on Windoze

Obtain AWS Access Key: Log into AWS > click on your User Name > My…