Author: kimconnect

How To Add or Remove a Path in Windows Environmental Paths

There are 2 functions to Add and Remove, at your convenience: # addEnvironmentalPath.ps1 $pathToAdd='C:\Scripts' $pathToRemove='C:\Scripts'…

PowerShell: Find Windows RDS Roles and Their Licensing Servers

# Get TS Licensing Servers (Enterprise or AD Registered) $termLicenseServers=Get-ADGroupMember -Identity "Terminal Server License Servers"…

How to Install Windows Dot Net 3.5 & 4.5

Run these commands to check dot net 3.5: PS C:\Windows\system32> import-module servermanagerPS C:\Windows\system32> get-windowsfeature web-asp-netDisplay…

PowerShell: Install App Using MSI on Remote Computers Via WinRM

# installMSiRemoteComputers.ps1 # version 0.0.1 $computernames='REMOTEPC001','REMOTEPC002' $thisMsiFile='C:\Temp\something.msi' $appName='testapp' $desiredVersion='1.0' $maxWaitSeconds=120 function installMsiOnRemoteComputers($computernames,$msiFile,$appName,$desiredVersion,$maxWaitSeconds){ function installMsiOnRemoteComputer{ param(…

Quick Note on Tomcat with NGINX

Below is a quick short-hand note to remind oneself to setup proxying properly between Tomcat…

PowerShell: Move Guest VM to Different Cluster in Hyper-V

# Assumptions: # - Guest VM files are stored at a single location # -…

PowerShell: How To Install VMM Agent on Hyper-V Nodes

# Update these variables to match your system $appName='Microsoft System Center Virtual Machine Manager Agent…

PowerShell: How to Convert Multi-Line Texts Into an Array of Strings

Significance: we often run into situations where a list of items (such as usernames, computernames,…

PowerShell: Remove Virtual Machine Snapshots in VMM

Base Cmdlets: $vmmServer='SOMETHINGHERE' $vmName='VMNAMEHERE' $snapshots=Get-SCVMCheckpoint -vmmserver $vmmServer -vm $(get-scvirtualmachine $vmName) $snapshots|%{Remove-SCVMCheckpoint -VMCheckpoint $_} Automation: #…

PowerShell: Add Local Group Members Onto a Server List

Sometimes, the GUI method of accomplishing tasks is too arduous and error prone. Thus, these…

Virtual Machine Manager Error ID 23351 FirstBootDevice Invalid

When moving, importing, exporting Generation 2 template in VMM, the following error occurs when trying…

PowerShell: Quickly Start Windows Services on Remote Computers

$computernames=@( "COMPUTER1", "COMPUTER2" ) $serviceName='windows_exporter' get-service $serviceName -computername $computernames|start-Service get-service $serviceName -computername $computernames|select MachineName,Name,Status Sample…

Hyper-V Dependency on Docker’s Networking Bridge Drivers

Background: Some naive systems engineer (yours truly) has provisioned a buck load of Hyper-V servers…

How To Fix Windows Corrupted Profile

Error messages: - We can't sign into your account. This problem can often be fixed…

PowerShell: Search Windows Event Logs

# searchWindowsEventsLog.ps1 $computername=$env:computername $logType='Security' $eventId=4732 $daysBack=365 $limit=9999 $messageLike="*Remote Desktop Users*" function searchWindowsEvents{ param( $computername=$env:computername $logType='Security'…

Changing User Password Using Command Lines or PowerShell

# Command-line method net user usernamehere newpasswordhere # Powershell Method 1 - via ActiveDirectory module…

PowerShell: Increase CPU Count or Memory of VMs via Virtual Machine Manager

# IncreaseCpuandRamViaVMM.ps1 # User Input Variables $vmNames=@( 'TESTWINDOWS', 'TESTWINDOWS2' ) $vmmServer=$env:computername $setCpuCount=8 $setDynamicMemory=$false $dynamicMemoryMinimumGB='2GB' $dynamicMemoryMaximumGB='16GB'…

PowerShell: Virtual Machine Snapshots Report from VMM Servers

# vmSnapshotReport.ps1 # Requirements: # - Credentials to access VMM Servers with Administrator role #…

PowerShell: Set VM Dynamic Memory in Virtual Machine Manager

# setVmDynamicMemoryInVmm.ps1 # Optimize Dynamic RAM $minGb='16GB' $maxGb='32GB' $startupGb='2GB' $buffer=20 $memoryWeight=5000 $forcedRestart=$false $vmmServer='localhost' function getUnoptimizedMemoryVms{…

PowerShell: Set DNS Records on Remote Computers

# setDnsEntries.ps1 $computernames=@( "$env:computername" ) $dnsServers=@( "8.8.8.8", "4.4.2.2" ) $results=[hashtable]@{} foreach ($computername in $computernames){ $psSession=new-pssession…