Month: March 2019

Windows Quick Short-cuts

Quick short-cuts:sysdm.cplcontrol printersdesk.cplpowercfg.cplncpa.cplgpedit.msccompmgmtlauncherwscui.cplfsmgmt.mscmsinfo32cleanmgr

Windows Active Directory Snapshots

Set scheduled task to run daily and call this maintainSnapshots.bat file:------------------------------@echo offREM Logs Location (Used…

HP Procurve Router: ACL Routing & OSPF

General ACL application------------------------------------------------------------------------ip access-list extended <NAME>deny ip <SOURCE>/<mask> <destination>/mask logpermit ip any any# There is…

Server PDC Time Clock Synchronization 

Configuring the Windows Time service to use an external time source To configure an internal…

User Account Group Membership Copy

This is the quick snippet to be executed in the context of a Domain Administrator:…

One-Liner: Capture Report of Logons in AD

echo %date%,%time%,%username%,logon,%computername% >> \\FILESERVER01\IT\scripts\logons.csv

Show Users Logons per Computer Names

# This script is to obtain log on information from a set of target computernames…

Typical Group Policies

Printers: set policy to automatically deploy printers, then allow logon to trigger the deployment and…

Quick and Dirty Script to Watch and Start / Restart Windows Service

// powershell.exe// -ExecutionPolicy Bypass c:\scripts\serviceCheck.ps1$serviceName = '[input-service-name-here]'$arrService = Get-Service -Name $serviceNamewhile ($arrService.Status -ne 'Running'){ Start-Service…

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…