[Kaseya Agent Procedure] – Run CHKDSK And Repair If Needed.

Free Kaseya Script – Run CHKDSK And Repair

Here is another free script from Cubert’s Dwelling, An Agent procedure that will run a CHKDSK in read only mode. Parse the output and run a chkdsk /F if it meets the criteria set forth in the script. It then emails an alert with the scan results to a email address provided before it uploads a copy of the scan to the get file for storage and review. Finally it updates 2 custom fields in the system info table with a brief result and the last run time. If it finds the disk healthy it will report as such if not it will report one of several error types.

Download Script Here

You will need to unzip the script and import it into Kaseya. Once imported edit the script and find the 2 places it email out and update the email address(es), Then you will need to add the 2 custom fields into your System-info table.

To add the custom fields:
1#  Open Kaseya and go to [Audit] – [View Individual Data] – [System Information] and select the button marked [New Custom Field]

2# The next box that pops up will create a new field, We will need to add 2 fields the first is CheckDisk Status and it will be a type String and Check Disk Updated with a type String.

Now run your disk check and see what it shows. If it meets with the right disk errors, a  repair is sent to the system and a email to you to reboot system when you can so the repair can complete. You can add another execute command under where we call the chkdsk /F with a shutdown -r -t 3 and that will cause the system to reboot its self after issuing the fix cmd. This is great for servers where your scheduling the disk scans during maintenance cycles but not so good with workstations where user gets booted up then a scan runs that then reboots the system will only inflame your users. So be mindful of how you use a shutdown cmd.

Enjoy

Cubert 🙂

Kaseya Agent Procedure -> Alert if Privileged Account are changed in Active Directory

Out of the skunkworks here at Squidworks comes a new Kaseya Agent Procedure. This procedure (Script) pulls all members of privileged accounts groups like Domain Admins, Enterprise Admins and Schema Admins and stores it to the GETFILE location on your K-Server. Also viewable using LiveConnect -> Agent Data -> GetFile Tab.  You can add and remove groups from the VBScript to match your needs. The nice thing about this script is it finds out what your Forest is and queries the domains inside. You do not need to edit script for every domain in your customer base. This 1 script will query any domain it is pointed at, with out knowing what the domain name is! (Sweet) This makes it a great tool to deploy across all customers as it requires no edits to run on any domain.

The script should be scheduled to run every day, each time it is run it copies a new file up to the GETFILE area and does a compare of the 2 files. If they are not exactly the same it will send an alert that a change has happened.

You then need to watch for this alert to happen and alarm on it. To do this you will goto your Monitor tab in Kaseya. In the main menu under Agent Monitoring select Alerts. In the main window under alerts you will find a drop down selection box called “Select Alert Function“. In this drop down list locate and select “Get Files” then select the AD server you are running the script on and set it to Alarm and email you upon change.

That’s It. It will check your accounts and if a change takes place it then alerts you that a change has happened to which you can investigate. This works great if you need to keep people out of these privileged accounts groups. 

AD Admin Audit Kaseya Script Zip

Enjoy

Cubert

Kaseya Agent Procedure – FTP Remote Client Backup Script

Backup Windows Systems to a FTP Server

Download: -> Kaseya FTP Backups

So you have Kaseya clients out on the wire that need some level of backup but are not near a NAS or USB Drive. Have thoes clients backup to a FTP server by using WinSCP and a Kaseya Script to do the job for you.

This script has several peices and can be customized for what ever need you have. I currently have the script setup in 3 files.

File #1 (WinSCP_Backup.bat) This is executed by the Kaseya script and passed 2 variables. The variables are the name of the local folder and the name of the remote folder you want to sync.

Example:

c\temp\WinSCP_backup.bat userA FTPdirA >> c\temp\backup.log

We call the BAT file passing “userA” and “FTPDira” this could be the users name for their home directory and the remote directory which could be any folder on your ftp minus the first “/”

File #2 (WinSCP_backup.txt) This file tells WinSCP how to connect to your FTP server and what root directories to start looking in for the folder names provided above. You need to edit this file adding your FTP server information, username and password for FTP if needed.

File #3 is WinSCP.exe, This is a freely available FTP and SCP client for windows that is very configurable and has CLI functions.

This set of scripts in it’s current form will allow you to sync the local systems users home directories to a remote FTP server.

Sync is currently one direction as shown below. But you can sync any way you want.
c:\Documents and Settings\username  -> ftp://ftp.domainname.com/foldername

 Enjoy

Cubert  😎

Scripts to be used at your own descression, no warranty is implied.

Kaseya 2 Agent procedures and free scripts

 

www.kaseya.com

 

Do you run Kaseya RMM and need some free scripts?

Here is a compilation of scripts I have created for Kaseya to do different tasks, feel free to use them but keep in mind there is no guarantee. Use at your own discretion!

# Blackberry Enterprise Server ( BES

 

www.kaseya.com


 

Do you run Kaseya RMM and need some free scripts?

Here is a compilation of scripts I have created for Kaseya to do different tasks, feel free to use them but keep in mind there is no guarantee. Use at your own discretion!

# Blackberry Enterprise Server ( BES ) server services restart script.

This script uploads a bat file “Blackberry_Restart.bat” that stops and restarts the Blackberry Enterprise server services in the correct order they need to be done. It the writes a event log entry to the local application event log on windows and then to the script log in Kaseya. Lastly it sends a email to help desk to let them know it ran. Download the zip file, unzip and import the XML file into Kaseya then upload the bat file to your public side Kaseya.

BlackberryES_Restart

# Retrieve IE History

Use this script to collect a logged in users IE history. When the boss wants to know what a users been surfing you can run this against the system and have it email all the links the user has gone to.

This script uploads and executes a VB scrpt (iehistory2.vbs) on the remote system that uses NirSoft’s IE History View utility (iehv.exe) to dump IE URL history addresses for all user profiles on the system into a text file (history.txt). The contents of the text file are then captured into a Kaseya variable and emailed to an address or addresses specified in STEP 7.  Download the zip file, unzip and import xml file in to scripts on Kaseay server then upload the vb script and iehv.exe to Kaseya public file store. Edit the Kaseya script at line item 7 and place in your email address.

IEHistory

# VMware VCenter Health Check

The script grabs the basic state of things on your VMware ESX VCenter VSphere server and posts an HTML file to the “get file” area in Kaseya KLC. It uses a PowerTools Shell to collect the data and create the file. Download the zip, unzip and import the XML file it scripts. Upload the ps1 file to Kaseya Public folder and then edit script and locate the file in script and save script. This will update the script with the location of where you saved the ps1 file.

VMWare VCenter Health Check

#Windows Systems CCleaner Script

This script is a great tool for cleaning of temp files and caches from a users profile on any Windows system. The script looks at the system and determines if it is 64 bit or 32 bit, then it downloads the correct ccleaner.exe file and runs it against the system. In auto mode this script does not clean the registry so it is safe to schedule and run on a regular bases. This works on all 32 and 64 it windows including Windows 2008 R2. A user must be logged in for script to run on users profile.

Kaseya-CCLeaner-Script

Look for more of my scripts here on Squidworks.net

Enjoy

Cubert