Category: Windows

Storage: Cohesity(tm) Basics

The intention of this posting is to critique a product known as Cohesity, a trademark…

WGET Error on Windows and Its Quick Resolution

Error:PS C:\temp> Invoke-WebRequest -Uri $fileInvoke-WebRequest : The response content cannot be parsed because the Internet…

VSS Error: Snapshots were found, but they were outside of your allowed context

Error: PS C:\Windows\system32> vssadmin delete shadows /for=c: /allvssadmin 1.1 - Volume Shadow Copy Service administrative…

PowerShell: Automating Microsoft Failover Cluster Maintenance – FileServer, SQL AlwaysOn, Hyper-V Guest VMs, Disks Operations

##################################################################################################### # MsClusterMaintenance_v0.0.2.ps1 # Author: KimConnect.com # License: GPLv3 # Description: this program automates the…

PowerShell: Add Windows TrustedHosts Remotely

<# AddTrustedHostsRemote.ps1Solves this problem:enter-pssession : Connecting to remote server REMOTESHERVER failed with the following error…

PowerShell: Optimize RAM on Remote Computers

# simultaneousExec_v0.01.ps1# Requirement: must run as Administrator$computerNames="SHERER1","SHERER2"function installEmptyStandbyList{ $emptyStandbyListAvailable=(Get-Command EmptyStandbyList.exe -ErrorAction SilentlyContinue); if(!($emptyStandbyListAvailable)){ # Set…

PowerShell: Remove an A-Host Record within Active Directory Integrated DNS Domain

Warning: this code is NOT 'production ready'. Please review and test on DEV environments carefully…

PowerShell: Add Accounts into Local Administrators Group

# addAccountToLocalAdmins.ps1# Requires: PowerShell Version 4.0+$accountToAdd='ServerAdmins'$groupName="Administrators"$servers=@( "CONCU1", 'CONCU2', 'CONCU100', 'CONCU80665', 'CONCU6547354', 'CONWHAT989', 'CONCU3')$servers|%{ $session=new-pssession $_…

PowerShell: Setting WSUS Registry Setting On/Off for Client Windows

# setWsusOnOff.ps1function setWsus{ param( [switch]$on, [switch]$off ) function wuRegistryIsOn{ # Check if this machine has…

PowerShell: Fix Clustered Disk Errors

# fixClusterDiskErrors.ps1function selectClusterName{ param($domainName=$env:USERDNSDOMAIN) write-host "Now scanning $domainName for all available cluster names. This may…

PowerShell: Windows Defender Controlled Folder Access

# Default Setting of Windows Defender:PS C:\Windows\system32> get-mppreferenceAttackSurfaceReductionOnlyExclusions :AttackSurfaceReductionRules_Actions :AttackSurfaceReductionRules_Ids :CheckForSignaturesBeforeRunningScan : FalseCloudBlockLevel : 0CloudExtendedTimeout…

PowerShell: How To Make A System App Do Nothing

# How-To-Make-Existing-System-App-Do-Nothing.ps1# Provide variables$hive="REGISTRY::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WORDPAD.EXE"$key="(default)"$value="C:\Windows\dummy.exe"$defaultValue="C:\Program Files\Windows NT\Accessories\WORDPAD.EXE"# Dummy-File-Creator.ps1$dummyFile="C:\Windows\dummy.exe"$output = new-object byte[] 1; (new-object Random).NextBytes($output);[IO.File]::WriteAllBytes($dummyFile, $output);if…

Active Directory: How to Copy Account

Run: DSA.MSC > navigate to the container of the user to be copied (e.g. Test…

Active Directory: How to Disable Account

RDP into a domain controller > Right-click the Windows icon on the bottom left corner…

PowerShell: Stop Any Service on Windows!

Problem: some system protected services cannot be stopped. PS C:\Users\KingKong> stop-service msmpsvcStop-Service : Service 'Microsoft…

PowerShell: Enable ISE

Import-Module ServerManager;Add-WindowsFeature PowerShell-ISE

Active Directory GPO Practical Examples

Fonts Distribution---------------------------------A. Create an SMB share on an Intranet accessible directory \\SOFTWARE\FONTS\Kim-Connect.ttfB. Create a new…

PowerShell: Windows Systems State Backup Daily

# Windows-Systems-State-Backup-V0.1.ps1## What this script does:# 1. Create a Windows Scheduled task on an Active…

PowerShell: 1-liner to obtain SSID and Password of Wireless Profiles on a Windows Machine

$profileName='Frontier0000'netsh wlan show profile "name=$profileName" key=clear|select-string "Key Content"# Sample outputKey Content : somepassword PS C:\Windows\system32>…

Procedure to Recreate a Microsoft Clustered Role

1. Delete cluster role 2. Validate that the DNS entry has been purgeda. Check DNS…