Author: kimconnect

Exchange: New-MoveRequest

New-MoveRequest -Identity '[email protected]' -TargetDatabase "DB01" -WhatIfNew-MoveRequest -Identity '[email protected]' -TargetDatabase "DB01"Get-Mailbox -Database DB01 | New-MoveRequest -TargetDatabase…

MySQL: List Database Size

SELECT table_schema "kimconnect",        ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in…

Discover FSMO roles

Option ExplicitDim WSHNetwork, objArgs, ADOconnObj, bstrADOQueryString, RootDom, RSObjDim FSMOobj,CompNTDS, Computer, Path, HelpTextSet WSHNetwork = CreateObject("WScript.Network")Set…

Find Hostnames per UserID in Event Logs on Domain Controllers

$targetAccounts=Get-Content "C:\Users\kimconnect\Desktop\targetAccounts.txt"function Get-UserComputerName { <#.SYNOPSIS Searches a specified Domain Controller for the computername of a…

Query Print Spooler of SERVER1

function getStatus($server, $service){    Get-WmiObject Win32_Service -Filter "Name Like 'spooler'" -computer SERVER1 -credential $cred | select…

Quick 1-Liner to List Domain Controllers and ReadOnly Statuses

PS C:\WINDOWS> Get-ADDomainController -Filter * | select Name,IsReadOnlyName       IsReadOnly----       ----------MONKEY       FalseBABOON       FalseGIRAFFE      FalseLION   FALSEKIMCONNECT   TrueKIMDISCONNECT TrueWHAT        TrueNOWAY        TrueWEBDC01      TrueWEBDC02      TrueSSO01        True

Function to list Domain Controllers

Wuick Script: # This function runs faster than the "Get-ADDomainController -Filter *" methodfunction listControllers{$domain =…

PowerShell RandomPassword Function

function randomPassword{    # return a reasonably randomized password that starts with "KimConnect:" plus 25…

SIP with Sonicwall Issues

Disabled SIP Transformations Enabled Consistent NAT Added a Service Group with SIP Ports 5060-5062, RTP…

Exchange 2010 Discovery Management

Prerequisites: Exchange Admins need these three roles to perform operations on mailboxes: Mailbox Search, Mailbox…

ipToHostname

Get-Content C:\Users\kimconnect\Desktop\ipList.txt | ForEach-Object {([system.net.dns]::GetHostByAddress($_)).hostname}

Windows Cleanup

#Clean Up the WinSxS FolderDism.exe /online /Cleanup-Image /StartComponentCleanup#Clean Up C:\Temp Folderdel c:\temp -Recurse -Force#Cleanup Event…

Windows Server Power Settings

powercfg /setactive SCHEME_MINpowercfg /hibernate offpowercfg -L

Harden Windows Server 2016

# IE Enhanced Security:$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"    Set-ItemProperty -Path…

Resolve Error: (59) An unexpected network error occurred

Prerequisites:   Ensure the the target machine has PowerShell Remoting Enabled (as it's Disabled by…

Import A WMWare.PowerCLI from Behind the Proxy

VMWare PowerCLI is a must for Administrators. Here's a quick script to install it. If…

Window Update Via PowerShell

Set Proxy netsh winhttp set proxy proxy-server="hqproxy:80" bypass-list="*.kimconnect.com;192.168.*.*;"[Microsoft.Win32.Registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU","UseWUServer",0,[Microsoft.Win32.RegistryValueKind]::DWord)restart-service wuauserv Enable Windows Update Repository: Set-ExecutionPolicy RemoteSigned…

Microsoft SQL AlwaysOn High Availability Cluster Management Tool

There are some bugs in the script. I'm too lazy to go back a fix…

Simple Active Directory & DNS Synchronization Script

@echo offGOTO push_or_pull:push_or_pullset /p action="Type in Push, Pull, or Quit. Press Enter for default action…

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…