Author: kimconnect

PowerShell: Automating Process of Setting Up a New Windows Machine

# Step -2: Creating a New Virtual Machine # Example A: Hyper-V # Compulsory variables…

PowerShell: Activate Remote Windows

$remoteWindows="SHERVER01","SHERVER02"$licenseKey="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"function activateWindows{ param( [string]$key ) $licensingService = get-wmiObject -query "select * from SoftwareLicensingService" -computername $env:computername;…

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>…

PowerShell: Execute as System Elevated Session with a Domain Administrator account

Part 1: Relaunch script in the context of Elevated System privileges: ############# Ensure that Program…

PowerShell: Update Windows Computers

There's a more updated version available. <# Update-Windows-Computers-v0.11.ps1 # # Purpose: trigger Microsoft Updates on…

PowerShell: Change IP of Remote Windows

# Change-IP-Remote-Windows.ps1$oldIP="192.168.40.135"$newIP="192.168.40.136"$netmask="255.255.255.0"$gateway="192.168.40.1"$dnsServers=@("10.10.8.1","10.10.18.1")function changeIpRemoteComputer{ Param ( [string]$oldIP, [string]$newIP, [string]$newSubnetMask = "255.255.255.0", [string]$newDefaultGateway, [array]$newDNS = @("8.8.8.8","4.4.2.2") )…

PowerShell: Kill Processes Remotely

# This function requires 2 parameters: -computerName and -processName function killRemoteProcess{ [cmdletbinding()] param( [string]$computerName=$env:COMPUTERNAME, [parameter(Mandatory=$true)]…

PowerShell: removing elements of an immutable “fixed size” array

By default, PowerShell's Array is an object class; hence, its length a "fixed size" as…

PowerShell: How To Bypass Double Hop Problems

# This is a working example of hoping without delegation. Fresh creds can be passed…

PowerShell: Reset Failover Clustering Quorum

# Adding Prerequisite Microsoft ClusterFunction installFailoverClustersModule{if (!(get-module -Name "FailoverClusters") ){#Install-WindowsFeature Failover-Clustering | out-null;Install-WindowsFeature RSAT-Clustering-MGMT |…

PowerShell: Create Daily VSS Snapshot of Volumes on Local Windows Machine

<# Daily-VSS-Snapshot-Windows-Standalone-FileServer.ps1 Functions: 1. Dynamically detect all volumes on local machine 2. Take snapshots of…

Procedure to Recreate a Microsoft Clustered Role

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

PowerShell: Windows Servers Systems Inventory

Version 0.03 <# Systems-Inventory.ps1Version: 0.03 -- deprecated 12/24/2019Purpose: to generate a CSV spreadsheet with information…

How to Implement Local Administrator Password Solution (LAPS) on Windows

Overview LAPS or Local Administrator Password Management is a good solution for local administrator account…

Changing SMB Caching on Windows

# To turn OFF caching $rolesWithNoCaching="SHERVER01","SHERVER02" $rolesWithNoCaching | %{$shares=Get-SMBShare -scopename "$_"; foreach ($share in $shares){if(!($share.Name…

How to Expand a Windows NTFS Volume as a LUN of HPe Nimble Storage

1. Take volume off synchronous mode - Pre-emptively avoid this error: "Failed to update the…

Updating SSL Certificates on Active Directory Federation Services (ADFS) Server

Scripted Version Notes: Part 1: Adding Cert to ADFS Server # Import Cert and get…

PowerShell: List All IPs Used by Cluster

Snippet: # Obtain IPs of resources in clusterfunction getResourceIPs { $resourceIPs=Get-Cluster | Get-ClusterResource | ?{$_.ResourceType…

PowerShell: Setup Windows Scheduled Tasks

Outdated script. Use something else by searching this blog further. # scheduledTasksRemote_V0.0.2.ps1# Purpose: to add…