Month: September 2022

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…

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…