Author: kimconnect

How to Fix Duplicate Computer Account Names Issue in Active Directory

Automatic cleanup: # disableDuplicateComputers.ps1 # Version 0.0.1 $defaultPasswordPeriod=30 $disabledComputersReport='c:\disabledComputersReport.csv' function disableDuplicateComputers{ param( $lastLogonDaysExceeding=30, $disabledComputersReport='c:\disabledComputersReport.csv' )…

PowerShell: Move Computer Objects in Active Directory

Version 2 # MoveComputers.ps1 # Version 0.0.2 # Obtain credentials being passed by Jenkins #…

Linux: Create a Shell Script to Watch Services

# create a script to watch services (notice the regex escape for special chars) sudo…

PowerShell: Use Win-SCP to Download Files from SFTP Server

Version 2: # downloadFilesViaSftp.ps1 # Version 0.0.2 # # Description: # This simple script is…

PowerShell: Invoke CRM Services Maintenance

Version 4: # invokeCrmServersMaintenance.ps1 # Version 0.0.4 # This script is a processes watcher on…

PowerShell: Update Local Windows Using COM Objects – Legacy Compatible

Although this function requires 'interactive' or console sessions, it can be trigged by Windows Scheduled…

How to Install OpenDNS Client on Ubuntu

Install the dynamic IP updater: # Install the appsudo apt-get install ddclient Press Enter repeatedly…

PowerShell: Remove a Scheduled Task By Name

# removeScheduledTask.ps1 # Set CoomputerNames $computerNames='sherver0001','sherver1000' $scheduledTaskName='SomeTaskName' # Obtain credentials $username='Domain\Admin' $password='PASSWORD' $encryptedPassword=ConvertTo-SecureString $password -AsPlainText…

How to Create a New Jenkins Job to Call a PowerShell Script with Credentials

1. PowerShell & Secured Credentials Support Check for PowerShell support: Manage Jenkins > Plugin Manager…

PowerShell: Get Ports to Process Connections / Associations

Current Iteration: Here is a quick snippet to enable Network Engineers and Systems dudes to…

PowerShell: Process Watcher – Perform CRM Async Services Maintenance

Update: this script is deprecated in favor of a better one here. Version 1: #…

PowerShell: Replacing Characters Inside Text Files

$textFilesDirectory="C:\Users\$env:computername\Desktop\test" $textFileExtensions='.txt' $regexNewlineOnly="(?<!\r)\n$" $replaceWith="`r`n" function updateFile{ param( $file="C:\Users\$env:username\Desktop\test.txt", $regexMatch="(?<!\r)\n$", $replaceWith="`r`n", $output ) $output=if($output){$output}else{$file} if($file -ne…

How to Install & Configure Pihole on Ubuntu 20.04

1. Installation- Run these commands: # sudo apt-get install gamin -ysudo curl -sSL https://raw.githubusercontent.com/pi-hole/pi-hole/master/automated%20install/basic-install.sh |…

How to Block Distracting Sites Such as Youtube and Hulu on Your Home Network

Overview: - You send a voice command 'block youtube' to Alexa, an Amazon personal assistant…

PowerShell: connectWinRM Function to Create New-PSSession

This reusable function may be included into PoSh scripts for better connection toward Windows machines…

PowerShell: Install Apps On List of Computers

[string[]]$computers=@( 'SERVER01', 'SERVER02', 'SERVER03' ) [string]$chocoAppName='notepad2' [version]$minVersion='4.2.25.20160422' $results=[hashtable]@{} foreach ($computer in $computers){ $result=invoke-command -computer $computer…

PowerShell: Installing or Including an Application On a Computer or Scripting Session

Sample Usage: PS C:\WINDOWS\system32> includeapp -appName notepadplusplus -appExe notepad++notepadplusplus version 7.91.0.0 already exists.True function includeApp($appName,$appExe=$False,$version){…

PowerShell: Renaming a System File

System files are typically owned by the TrustedInstaller account and protected from deletion or changes.…

PowerShell: Replacing Notepad with Notepad Plus Plus

Update 12/04/2020: there's a simpler solution - install notepad2! choco install notepad2 -y The command…

How to Host Multiple Domains with SSL Using Microsoft Information Service (IIS)

Step 1: Add SSL Certs into the computer information store Here's a sample script to…