Blog

PowerShell: Rename Hyper-V Object and Clustered Role Resource

$oldName='testWindows' $newName='server01.intranet.kimconnect.com' # Rename Hyper-V Clustered Resource: Guess VM $vm=Get-clustergroup -Cluster (get-cluster).Name -Name $oldName $vm.Name=$newName…

PowerShell: Detect Microsoft SQL Version and Installed Location

function getSqlInfo{ $results=@() $instances=(get-itemproperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server').InstalledInstances foreach ($i in $instances){ $p=(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance…

Use CMD to Kill All Instances of a Program / Process

This can be invoked in an un-elevated session. The command is: taskkill /F /IM <PROGRAM.EXE>…

Adding a Domain Security Group into the Hyper-V Administrator Users Group

Issue: Resolution: Click Start > Control Panel > Administration Tools > Computer Management > System Tools…

Toner Cartridge CF283A vs CF283X

These toners will work with HP Pro MFP M127fw M127fn M125nw M201dw M201n M225dn M225dw…

WordPress NextGen Gallery Plugin Error

Error Message: Failed to load plugin url: /bitnami/wordpress/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js?ver=3.17 Resolution: Although the root cause hasn't been…

PowerShell: Update Cryptocurrency Prices in WordPress WooCommerce

In the absence of true integrated plugins in WordPress to perform scripted actions (updating certain…

PowerShell: Remove A-record in Bluecat

$bluecatUri='https://bluecat.kimconnect.com/Services/API' $bluecatUsername='bluecat-service-api' $bluecatPassword='SOMECOMPLEXPASSWORD' $hostRecord='testrecord.kimconnect.com' function loginBluecat{ param( $username, $password, $uri ) $proxy = New-WebServiceProxy -Uri…

PowerShell: Get SQL Job History

$computername='sql01' function getSqlJobHistory($sqlServerName){ try{ if(!(get-module SqlServer)){ Install-Module -Name SqlServer } Import-Module -Name SqlServer $sqlServerInstance=Get-SqlInstance -ServerInstance…

PowerShell: Get SQL Server Backup Statuses

$computername='sql01' function getSqlBackupInfo ($sqlInstanceName=$env:computername, $dbName){ [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") $location=if($sqlInstanceName.Contains("`\")){ "SQLSERVER:\SQL\$sqlInstanceName\Databases" }else{ "SQLSERVER:\SQL\$sqlInstanceName\DEFAULT\Databases" } function getPacificTime($time){ if($time){ [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId($time,'Pacific…

Using SysPrep To Move Windows Users Directory

Assumptions: Windows 2019 Server Standard ISO is mounted as E:\ D:\Users will be the new…

WordPress: Remove ‘Built with Storefront & WooCommerce’ in footer

Credit: @jobthomas Automattic Happiness Engineerhttps://wordpress.org/support/topic/remove-built-with-storefront-footer-link-2/ How to apply: search and install Code Snippets > add…

Use PowerShell to Set Microsoft SQL Database Owner

$owner='CAP\SQL Admins' $databaseName='TestDb' $sqlServer=$env:computername function setDbOwner{ param( $principle=$env:USERDOMAIN+'\Domain Admins', $databaseName='TestDB', $sqlServer ) function includeSqlTools{ $ErrorActionPreference='stop'…

Use PowerShell to Grant SysAdmin Role to Certain Users

$principle=$env:USERDOMAIN+'\Domain Admins' $sqlServer=$env:computername function includeSqlTools{ $ErrorActionPreference='stop' try{ $trustedPsgallery=(Get-PSRepository PSGallery).InstallationPolicy -eq 'Trusted' if(!$trustedPsgallery){ Set-PSRepository -Name PSGallery…

PowerShell: Auto Login to WordPress and Update Gold Prices WooCommerce Plugin

# API URI - these are examples, only $goldPriceApi='https://dragoncoin.com/XAU/USD' $silverPriceApi='https://dragoncoin.com/XAG/USD' $platinumApi='https://dragoncoin.com/XPT/USD' $palladiumApi='https://dragoncoin.com/XPD/USD' # Wordpress WooCommerce…

WordPress: Gold Price Widget CSS

Here's a sample of CSS Code to customize the display of the WordPress' Gold Pricing…

Windows: Disable Automatic Restart After Updates

1. Run gpedit.msc as Administrator2. Navigate to Local Group Policy Editor > Computer Configuration >…

PowerShell: Remove IP Address Assignment Using Bluecat API

$bluecatUri='http://bluecat.kimconnect.com/Services/API' $bluecatUsername='svc-bluecat-api' $bluecatPassword='PASSWORD' $configId=17 $ipv4Address='10.10.162.54' $marker='toBeDeleted-' function confirmation($content,$testValue="I confirm",$maxAttempts=3){ $confirmed=$false; $attempts=0; $content|write-host write-host "Please review…

PowerShell: Unjoin Computer From Domain

# unjoinComputerFromDomain.ps1 # Version 0.02 # Notes: # - This function doesn't delete the referenced…

Windows Server 2019 Remote Desktop Black Screen Problem

While there's no definite solution to this issue, here are some options to work around…