Month: August 2022

How To Use CredSSP to Move Virtual Machines In a Hyper-V Cluster

# Prep on Client $domain='intranet.kimconnect.com' Enable-WSManCredSSP -Role "Client" -DelegateComputer "*.$domain" # Prep on Server Enable-WSManCredSSP…

Incomplete VM Configuration

Quick Script: # fixIncompleteVmConfig.ps1 $IncompleteVMConfig=Get-SCVirtualMachine|?{$_.StatusString -eq 'Incomplete VM Configuration'} if($IncompleteVMConfig.count){ foreach($vm in $IncompleteVMConfig){ try{ write-host…

How to Remove ‘Ghost’ VMs with Status ‘Off-Critical’ or ‘Saved-Critical’

Issue: Resolution: get-vm|?{$_.State -in @('OffCritical','SavedCritical')}|remove-vm -force

Installing DotNet 3.5 on Windows with Restricted Internet Access

# Set Windows Source files # Assuming that a Windows ISO / DVD Rom have…

Windows: How To Expand Disk Volumes That Are Not Adjacent the Intended Volume

Problem: Here's a scenario when a virtualized disk has been expanded in Hyper-V, Vmware, AWS,…

Disable and Enable Trace Logging for Dynamics CRM

# Set common variables $serverTracingRegistry='Registry::HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\MSCRM' # Enable CRM Tracing Add-PSSnapin Microsoft.Crm.PowerShell $setting = Get-CrmSetting TraceSettings…

PowerShell: Find Locking PID of a File

$filePath="C:\Program Files\Google\Chrome\Application\chrome.exe" function findPidOfFile($filepath){ try{ if (!(Get-Command handle.exe -ErrorAction SilentlyContinue)) { if (!(Get-Command choco.exe -ErrorAction…

How to Move Windows Partitions

Problem: Resolution: choco install partition-assistant-standard -y Click a few buttons > done. Result:  

PowerShell: Enable TLS 1.2 on Windows

function enableTls12{ try{ $null=New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -Force $null=New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -Force $null=New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server'…

PowerShell: Automatically Log Off Idling Remote Desktop Sessions

Add this script to your task scheduler or Jenkins job to automatically log off Idling…

PowerShell: Get LastLogon Information of Computer Objects

$computernames=@( 'COMPUTER1', 'COMPUTER2' ) $computerLastLogon=foreach($computerName in $computernames){ get-adcomputer $computerName -Properties LastLogon|select Name,@{Name='LastLogon';e={[DateTime]::FromFileTime($_.LastLogon)}} } $computerLastLogon|sort -Property…