Category: Windows

Fiddler: A HTTPS Debugging Tool

An application support specialist would find this tool useful to intercept HTTPS traffic on a…

PowerShell: Set Auto Logon

Instead of running the GUI method (netplwiz), there's a more efficient way to set auto…

PowerShell: Maintain Windows Services Remotely via WinRM

# maintainServices.ps1 # FQDN of each computer name (required) $computerList=@' testWindows.intranet.kimconnect.com testWindows.dmz.dragoncoin.com '@ $serviceNames=@( 'windows_exporter',…

PowerShell: Kill a Windows Service Forcefully

# killService.ps1 $serviceName='vmms' function killService($serviceName='Spooler',$restart=$false){ $processId=Get-WmiObject -Class Win32_Service -Filter "Name LIKE '$serviceName'"|Select-Object -ExpandProperty ProcessId if($processId.count…

How to Install PowerShell Module on An Offlined Computer

# Download the desired module onto a 'jump host' (an intermediary computer that has access…

PowerShell: Uninstall Program Using Its Name

# uninstallProgramUsingId.ps1 $appName='Virtual Machine Manager Agent' $uninstallStringRegPaths='HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall' $uninstallStrings=Get-ChildItem -Path $uninstallStringRegPaths $uninstallString=($uninstallStrings|Get-ItemProperty|Where-Object {$_.DisplayName -match $appName}).UninstallString if($uninstallString.count…

PowerShell: Get Connected Port by Process Name

# getProcessConnectionPort.ps1 $computerlist=@' SQL1 SQL2 '@ $computernames=@($computerList -split "`n")|%{$_.Trim()} $processname='sqlservr' $state='Established' $results=@() foreach ($computername in…

PowerShell: Quickly Test Connectivity from a List of Sources toward a Destination on a Specific Port

# testRemotePort.ps1 $connectFrom=@' windows1 windows2 '@ $connectTo=@' \\servername\sharename '@ $testPort=445 $sources=@($connectFrom -split "`n")|%{$_.Trim()} $destinations=@($connectTo -split…

How To Recover SQLSERVER Service from Being Unable to Start

# startSqlService.ps1 # special provision to deal with SQL Server not starting up due to…

Resume All Guest VMs in a Clustered Hyper-V Environment

# resumeAllVms.ps1 # Significance: this script is useful in a Clustered Hyper-V environment # where…

PowerShell: Command to Retrieve Windows Applications List

The following the the PoSH equivalent of appwiz.cpl in Windows: PS> invoke-command TestWindows {Get-Package -Provider…

How to Search for Installed Application by Name in PowerShell

One can search using the known Vendor or application Name as illustrated below: [testwindows]: PS…

PowerShell: Create Registry Keys within Windows Localhost

# createRegKey.ps1 $regKeys=@( @{ hive='REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome'; name='ChromeCleanupEnabled'; value=0 } @{ hive='REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome'; name='ChromeCleanupReportingEnabled'; value=0 } ) function…

Windows: How to Map Network Drive for All Users of a Local Machine

# Mapping file share using legacy commands (more effective than newer PowerShell equivalents in certain…

How to Set PowerShell Window and Prompt Title or Label

Have you ever wondered about changing the boring PS C:\Windows\system32> whenever a new window is…

Use DISM To Install Windows Features

Deployment Image Servicing and Management (DISM.exe) is a command-line tool that can be used to…

PowerShell: Get Available RAM Slots

# getRamSlotsAvailable.ps1 $computername=$env:computername function getRamSlotsAvailable{ param($computername=$env:computername) write-host "Computer name: $computerName" $slots = Get-WmiObject -Class "win32_PhysicalMemoryArray"…

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…