Blog

How To Clear ARP Table in Windows?

Answer: Nothing fancy, just use this simple legacy command: netsh interface ip delete arpcache Done.

Windows Event ID 2017: Unable to collect NUMA physical memory utilization data

Issue: Log Name: ApplicationSource: Microsoft-Windows-PerfOSDate: 9/12/2018 7:47:38 AMEvent ID: 2017Task Category: NoneLevel: WarningKeywords: ClassicUser: N/AComputer:…

PowerShell: How To Append to Windows Environmental Paths Permanently

Often, when we install applications such as Python, its bin directory may not automatically be…

PowerShell: Grant SMB Access

# grantSmbAccess.ps1 $computername='fileserver' $shareName='TEST' $account='domain\groupOrUsername' $accessType='read' # also change or full invoke-command -computername $computername -scriptblock{…

Issue: A-Host Records Disappear in an Active Directory Integrated DNS Environment with Windows DHCP Server

Issue: Certain virtual machines would loose their a-host records after a period of time. That…

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…

PowerShell: How to Reset Windows Update Service

# resetWindowsUpdateService # This is a legacy method of reseting Windows Update # Since most…

PowerShell: How To Stop and Start Palo Alto Cortex XDR Traps

$trapsAdminPassword='PASSWORDHERE', $trapsBin='C:\Program Files\Palo Alto Networks\Traps' function stopXdr{ param( $trapsAdminPassword, $trapsBin='C:\Program Files\Palo Alto Networks\Traps' ) echo…

PowerShell: Maintaining Processes on Remote Servers

# maintainProcess.ps1 # version 0.0.1 $computernames=@( 'server1', 'server2' ) $processName='cmd' $processPath='C:\WINDOWS\system32\cmd.exe' $minutesToDefineCrashed=1 # this marker…

How to Disable Disk Checking on Windows Bootup

Run CMD or PowerShell as Administrator Issue this command to exclude checking of Systems volume…