Month: December 2020

An Issue with RSA Key On CentOS 8

Error message seen by checking SSH Daemon status: [root@linux1 testadmin]# service sshd statusRedirecting to /bin/systemctl…

How to Disable SELINUX on CentOS 8

SELinux is a sort of system-call firewall, where processes are in their run spaces. When…

Network Time Protocol for CentOS 8

Check hardware clock [root@sftp testadmin]# hwclock --verbosehwclock from util-linux 2.32.1System Time: 1608158426.341727Trying to open: /dev/rtc0Using…

PowerShell: Maintain Linux Services via SSH Remoting

Version 2: # maintainLinuxServices.ps1 # Version 0.0.2 # Description: this is a simple script to…

PowerShell: Probe Remote Machine for Its OS Type

function probeOsType($server){ $ping=test-connection $server -count 1 $ttl=$ping.ResponseTimeToLive $osType=switch($ttl){ {$_ -le 64} {"Linux"; break} # MacOs…

Windows Firewall Block ICMP Ping

Following is a quick exercise in configuring Windows firewall to block certain protocols: # Disable…

Update Windows with Restricted Internet Access

This script is an extract of a longer version with the features of simultaneous executions…

Linux: Shell Script to Reboot Remote Devices Daily

Set Variables remoteDevice=10.25.0.20username=adminpassword="PASSWORDHERE" Install sshpass if it doesn't exist if ! sshpass -v sshpass &>…

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…