Category: Codes

PowerShell: Backup Microsoft Dynamics CRM Database

# backupCrmOrgDatabase.ps1 # This script is to be invoked in the context of the Administrator…

PowerShell: How to Quickly Ping a Target

Method 1: Legacy ping command # Legacy method that works without any fusses $pingResult=ping google.com…

PowerShell: Get Failed Scheduled Tasks on a Windows Machine

The following function will query the local Windows Tasks Scheduler for custom schedules and output…

Linux: GREP Training

Lorum Ipsum - let's learn about grep, ya'll Examples: # Get information only on the…

PowerShell: Get Windows Resource Utilization

# getWindowsResourceUtilization.ps1 # version 0.02 # Gather information on a list of Windows Machines #…

PowerShell: Automating Dynamics CRM Migration

This is the source code that has been used to move hundreds of Dynamics CRM…

How To Format HTML Content For Email

Major email service providers such as Google Gmail and Microsoft Office 365 have been supporting…

PowerShell: Time Stamp Variable

This is useful in almost any script as it enables the accurate timestamp of log…

The 10 Commandments of C Programming

Source: some ancient programming god Thou shalt run lint frequently and study its pronouncements with…

Java Virtual Machine Optimal Memory Tuning

Overview: There are five available garbage collectors (GC) for Java Virtual Machines (JVM). Here are…

Linux: Using Bash to Search for Files Matching Certain Extensions

# using tree: list any files in a directory parentDirectory=/home tree --prune $parentDirectory # using…

Expanding System Volume C Drive of Windows Hyper-V Virtual Machine

There are three three steps to expand a disk of a virtual machine: Connect to…

PowerShell: Reset Windows 10 to Default Factory Settings

The easiest (GUI) method: systemreset -cleanpc The automated method: # Experimental code: not working yet…

PowerShell: Set Autologon for Windows

Current Version: function setAutoLogon($username,$password){ $regWinlogon='REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' $regKeyUsername='DefaultUserName' $regKeyPassword='DefaultPassword' $kegKeyAutologin='AutoAdminLogon' $regKeyDefaultDomain='DefaultDomain' function testCredential($username,$password){ # Get current…

Listing SMB Shares on a Windows Machine

Option 1: PS C:\Windows\system32> get-WmiObject -class Win32_Share Name Path Description ---- ---- ----------- ADMIN$ C:\Windows…

PowerShell: Quick Script to Get Storage Utilization

$volumes = (gwmi -Class win32_volume -Filter "DriveType!=5" -ea stop| ?{$_.DriveLetter -ne $isnull}|` Select-object @{Name="Letter";Expression={$_.DriveLetter}},` @{Name="Label";Expression={$_.Label}},`…

Bash Shell Quick If Then and Case Switch Statements

protocol=udp # or tcp # If-then implementation if [$protocol == udp] then prefix=@ else prefix=@@…

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…

Update Windows with Restricted Internet Access

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