cyanghost.com v2
You are here: cyanghost > Scripts

Scripts


Here are some downloadable scripts I wrote for various uses. I hope you find them beneficial. Please run them in an isolated test environment before rolling them out to your production servers. Please note that I consider myself pretty green at this, so if you find a way to make them better, I'd be happy to hear from you.

As a safety precaution, Windows may not allow some scripts to run by default. In an elevated PowerShell session, you may need to type Set-ExecutionPolicy Unrestricted and/or Set-ExecutionPolicy Unrestricted -Scope CurrentUser to run some of these scripts. Before doing that, please read more about that here and understand the risks involved with doing so.


PowerShell: Create Encrypted Password for PowerShell

One line, but I'm putting it here anyway for future reference. If you need to put a password in a PS script, you can use this to encrypt the password. Places Password.txt in your current working directory. Instructions for use are commented out in the script.

create-encrypted-password.ps1


PowerShell: Backup Microsoft SQL Server Databases and delete them after 30 days

This PowerShell script uses the sqlcmd utility to create .bak files of the SQL databases then deletes any files older than 30 days. Instructions are commented in the file and are pretty easy to follow.

Backup-MSSQL-Databases.ps1


PowerShell: Monitor Ping Status w/ Email Alert

This one will send a ping out to any specified IPs and will notify you via email if one of the hosts don't respond. Useful for monitoring critical routers, switches, servers, etc. in an environment.

ping-status.ps1


PowerShell: Remote into Remote Desktop Session

Allows you to remotely view and control a user's Remote Desktop Session. The server(s) must be running Remote Desktop Services for it to work.

remote-into-rd-session.ps1


PowerShell: Wordlock Decoder

DISCLAIMER: Please do not use this for malicious intent. I made this simply for fun because I was challenged to crack someone else's lock with their permission. Please make sure you do the same as stealing just isn't a nice thing to do and there's far too much of it as it is.

Ever wanted to manually brute force a word lock? I was challenged by someone to do so once, little did they know I could use PowerShell to list all possible combinations. So, that's exactly what this script will do. Imagine their surprise when I gave it back to them, unlocked.

This will work with 4-dial and 5-dial locks.

Instructions: Download the wordlock-decoder.ps1 file below (right click it and then click Save link as...) to your computer. Navigate to it, right click on the file and then click Run with PowerShell. From there, you can follow the onscreen instructions.

wordlock-decoder.ps1

For simplicity, I also compiled an exe file of the Wordlock Decoder. You may download it here.

If Windows Defender SmartScreen states that it's an unrecognized app, you may click More info and then Run anyway to bypass the warning. Otherwise, you will need to use the PowerShell method above.


PowerShell: Add Computer to the Domain

This PowerShell script will join a computer to a domain.

Add-Computer-to-Domain-and-Restart.ps1


PowerShell: Migrate User Profile Contents to Network Folder

This PowerShell script will migrate the local user's Desktop, Documents, Downloads and Favorites folder to a network drive.

Migrate-Profile-Files-to-Domain.ps1


PowerShell: Copy new INI file for ClinicTracker EHR program

This PowerShell script will copy a new ClinicTrackerOptions.ini file to the specified user's directory onto multiple Remote Desktop servers in a Connection Broker.

Copy-New-ClinicTrackerOptions-INI-File.ps1


More to come!

Go Back > (index page)