Author: kimconnect

PowerShell: Chicken Scratch Ports Scanner

Although there are optimized applications to perform this task such as Angry Port Scanner, NMAP,…

PowerShell: Setting Windows Pagefile

# setPageFile.ps1 # Source: # Reposting here as such code seems to be open source…

PowerShell: Optimize SQL Server Memory & CPU Resources

# optimizeSqlServer.ps1 # Version 0.0.2 # This version deals with Memory, CPU # Future versions…

Ubuntu/Lubuntu: Setting Up Development Environment

Linux is a great platform for development. One advantage of a this OS is that…

Linux: An Experience in Resizing a Root Partition

Scope: These instructions are intended for Linux systems without Logical Volume Manager (LVM). For that…

Logical Volume Management: A Practical Illustration

# Runas root kim@kimlinux:~$ sudo su - # List all disks fdisk -l | grep…

PowerShell: List All Hyper-V Snapshots of All VMs in All Clusters in Domain

# listHyperVSnapshots.ps1 $clusterName='*' function listAllHyperVSnapshots([string[]]$clusterName){ function includeRSAT{ $ErrorActionPreference='stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 #$rsatWindows7x32='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x86-RefreshPkg.msu' $rsatWindows7x64='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x64-RefreshPkg.msu' $rsatWindows81='https://download.microsoft.com/download/1/8/E/18EA4843-C596-4542-9236-DE46F780806E/Windows8.1-KB2693643-x64.msu' $rsat1709…

PowerShell: Gather All Guess VM of All Hyper-V Clusters in the Domain

# getAllVms.ps1 $clusterName='*' function includeRSAT{ $ErrorActionPreference='stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 #$rsatWindows7x32='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x86-RefreshPkg.msu' $rsatWindows7x64='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x64-RefreshPkg.msu' $rsatWindows81='https://download.microsoft.com/download/1/8/E/18EA4843-C596-4542-9236-DE46F780806E/Windows8.1-KB2693643-x64.msu' $rsat1709 = "https://download.microsoft.com/download/1/D/8/1D8B5022-5477-4B9A-8104-6A71FF9D98AB/WindowsTH-RSAT_WS_1709-x64.msu"…

PowerShell: Get All Hyper-V Servers in the Domain or Forest

This is a working version to correct my previous codes posted somewhere on this site…

Windows: Create a Quick Hot Spot From A Wired Computer with Spare Wireless Adapter

# Start the Hot Spot netsh wlan set hostednetwork mode=allow ssid="$env:username hotspot" key=whatpassword netsh wlan…

PowerShell: Remove Hyper-V VM Snapshots

Hyper-V's snapshot feature is a double-edged sword. It's a convenient method to make a quick…

PowerShell: Set Hyper-V Cluster Quorum

# setClusterQuorum.ps1 # version 0.01 $clustername=$null $clusterQuorum="\\FILESHERVER007\CLUSTER007" $resetPrior=$false function setClusterQuorum($clusterName,$clusterQuorum,$resetPrior=$false){ # Get clustername, if not…

PowerShell: Get Quorums of All Clusters in the Domain

# getClusterQuorum.ps1 function getClusterQuorum{ $allClusters=(get-cluster -domain $env:USERDNSDOMAIN).Name $results=@{} foreach ($cluster in $allClusters){ $quorum=Get-ClusterQuorum -Cluster $cluster…

PowerShell: Take VM Snapshots

# takeVmSnapshot.ps1 $vmNames='Test-VM1','Cowabunga-VM4' $snapShotLabel="Snapshot $(get-date -Format yyyyMMddTHHmmss)" function takeVmSnapshot([string[]]$vmName,[string]$snapshotLabel){ $vmClusterNodes=Get-ClusterGroup|?{$_.GroupType -eq 'VirtualMachine'} foreach ($vm in…

PowerShell: Disable Virtual Machine Queuing on Hyper-V Hosts

What is VMQ? Virtual Machine Queuing is a shortcut to deliver packet data from the…

PowerShell: Email Users with Expiring Passwords

# PasswordExpirationNotification.ps1 # Description: # This script performs the following tasks # a. Query Active…

PowerShell: Manage Remote Desktop Servers by Logging Off Idle Sessions That Have Certain Inactive Programs

# manageRdsSessions.ps1 # Sequence of workflow: # a. Gather active and disconnected sessions on all…

PowerShell: Find Duplicate RDP Sessions on All Remote Desktop Servers Discovered Within the Domain

There's this module called 'PSTerminalServices' that has a method to collect active sessions on all…

Setting Trace Logging for MS Dynamics CRM

Function 1: Set CRM Tracing # crmTraceLogSettings.ps1 $traceDirectory="L:\crmTraceLogs" $enable=$false $categories='*:\Verbose' $fileSize=10 $resetIis=$true function setCrmTrace{ param…

PowerShell: Move Files Into Zip

# moveFilesToZip.ps1 # Version 0.02 # This little function is to automate the process of…