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.

How-to Emulate the TOP command in Windows

Top is a Linux process that shows a list of processes running on the system and what levels of resources are being used. This application provides all processes running, the CPU and Memory consumed and with several switches available you can see things like the location of the executable that is running.

Unfortunately, they don’t make a TOP executable ported for Microsoft Windows but don’t despair.   You can

Top is a Linux process that shows a list of processes running on the system and what levels of resources are being used. This application provides all processes running, the CPU and Memory consumed and with several switches available you can see things like the location of the executable that is running.

Unfortunately, they don’t make a TOP executable ported for Microsoft Windows but don’t despair.   You can use Power Shell to script a simple TOP style display that operates just like TOP on a Linux system.

 

Here is the one liner you need to get a top style process viewer running on windows.

while (1) { ps | sort -desc cpu | select -first 30; sleep -seconds 2; cls }

 

Copy the above line and paste it in to your Power Shell console. You should see something similar to the following image.

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

How to configure Windows TCP/IP settings from the Command Prompt (CLI)

Window’s Netsh.exe command-line scripting utility  allows you to display or modify the network configurations of any computer that is currently running a resent flavor of Windows. Netsh.exe also provides a scripting feature that allows you to run a group of commands in batch mode against a computer both locally and remotely.  You can also use Netsh.exe to save a configuration script in a text file for archival purposes or to help you configure

Window’s Netsh.exe command-line scripting utility  allows you to display or modify the network configurations of any computer that is currently running a resent flavor of Windows. Netsh.exe also provides a scripting feature that allows you to run a group of commands in batch mode against a computer both locally and remotely.  You can also use Netsh.exe to save a configuration script in a text file for archival purposes or to help you configure network information when changing networks.

Here are your commands and what they can do.

View your TCP/IP settings.

netsh interface ip show config

 

Configure your computer’s IP address and other TCP/IP related settings.

This command configures the interface named Local Area Connection with the static IP address 192.168.0.101, the subnet mask of 255.255.255.0, and a default gateway of 192.168.0.1:

netsh interface ip set address name="Local Area Connection" static 192.168.0.101 255.255.255.0 192.168.0.1 1

Configure your NIC to automatically obtain an IP address from a DHCP server

netsh interface ip set address "Local Area Connection" dhcp

To configure DNS and WINS addresses from the Command Prompt

netsh interface ip set dns "Local Area Connection" static 192.168.0.101
netsh interface ip set wins "Local Area Connection" static 192.168.0.101

To configure your NIC to dynamically obtain it’s DNS settings

netsh interface ip set dns "Local Area Connection" dhcp

Now let’s say you have a laptop and it travels between 2 separate networks and you need to maintain separate static configurations for each network. There is a simple way to flip back and forth between networks by creating a simple batch file. Here is how it’s done.

First we export your current IP settings to a text file:

netsh -c interface dump > c:\network1.txt

Next we change the settings manually on the interface to the second network and then export it as well:

netsh -c interface dump > c:\network2.txt

Now we have 2 text files, each file represents a network location. Whenever you need to quickly change your IP settings to switch between networks you can run the following commands

netsh -f c:\network1.txt
or
netsh -f c:\network2.txt

Now to make a batch file to execute the command just create a file called network1.bat and network2.bat and add the perspective line to that file. You can also use the global EXEC switch instead of  “-f ”  switch in the batch file with the same results.

Here are all the options available to netsh.exe

Usage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName\]UserName] [-p Password| *]
    

Commands available:

?              – Displays a list of commands.
add            – Adds a configuration entry to a list of entries.
advfirewall    – Changes to the `netsh advfirewall’ context.
branchcache    – Changes to the `netsh branchcache’ context.
bridge         – Changes to the `netsh bridge’ context.
delete         – Deletes a configuration entry from a list of entries.
dhcp           – Changes to the `netsh dhcp’ context.
dhcpclient     – Changes to the `netsh dhcpclient’ context.
dnsclient      – Changes to the `netsh dnsclient’ context.
dump           – Displays a configuration script.
exec           – Runs a script file.
firewall       – Changes to the `netsh firewall’ context.
help           – Displays a list of commands.
http           – Changes to the `netsh http’ context.
interface      – Changes to the `netsh interface’ context.
ipsec          – Changes to the `netsh ipsec’ context.
lan            – Changes to the `netsh lan’ context.
mbn            – Changes to the `netsh mbn’ context.
namespace      – Changes to the `netsh namespace’ context.
nap            – Changes to the `netsh nap’ context.
netio          – Changes to the `netsh netio’ context.
p2p            – Changes to the `netsh p2p’ context.
ras            – Changes to the `netsh ras’ context.
rpc            – Changes to the `netsh rpc’ context.
set            – Updates configuration settings.
show           – Displays information.
trace          – Changes to the `netsh trace’ context.
wcn            – Changes to the `netsh wcn’ context.
wfp            – Changes to the `netsh wfp’ context.
winhttp        – Changes to the `netsh winhttp’ context.
winsock        – Changes to the `netsh winsock’ context.
wlan           – Changes to the `netsh wlan’ context.

 

Enjoy

Cubert

“Terminal Server Has Exceeded the Maximum Number of Allowed Connections” fix via Command line (CLI)

The terminal server has exceeded the maximum number of allowed connections. The system can not log you on. The system has reached its licensed logon limit. Please try again later.”

This problem happens because Windows only allows two remote terminal services connections when you are in administrative mode, and you’ve either got two people already on that server, or more likely, you’ve got a disconnected session that still thinks it

The terminal server has exceeded the maximum number of allowed connections. The system can not log you on. The system has reached its licensed logon limit. Please try again later.”

This problem happens because Windows only allows two remote terminal services connections when you are in administrative mode, and you’ve either got two people already on that server, or more likely, you’ve got a disconnected session that still thinks it is active.

The problem with this error is that you have to actually get on the server console to fix the problem if the server isn’t in a domain. (If you are in a domain, then just open Terminal Services Manager and log off or disconnect the sessions)

Here’s a command line arguments that you can use to figure out what sessions are connected to the server. Note that you could substitute the IP address for the server name.

query session /server:servername

Output:

Now we know that the session ID of the offending session is 2. We can use that in the next step, which is using the reset command to log off that user.

reset session [ID] /server:servername

This command won’t display any output, but when we run the query command again, we should see that the session has now been disconnected:

Output:

I hope this helps to get you back in to your terminal sessions!

Enjoy…

The ordinal 3719 could not be located in the dynamic link library LIBEAY32.dll

JailBreaking Iphone 3.1.3 on Windows XP

If your using the new Spirit.exe on windows you may get a error or 2. Not a big issue at all. Here is how to fix the 2 most common errors

You may get the error code displayed by Spirit  “error code: c0000138″

To solve the problem, copy the file c:\Program Files\Common Files\Apple\Mobile Device Support\bin\libeay32.dl

 to c:\Windows\System32\

Then run

JailBreaking Iphone 3.1.3 on Windows XP

If your using the new Spirit.exe on windows you may get a error or 2. Not a big issue at all. Here is how to fix the 2 most common errors

You may get the error code displayed by Spirit  “error code: c0000138″

To solve the problem, copy the file c:\Program Files\Common Files\Apple\Mobile Device Support\bin\libeay32.dl

 to c:\Windows\System32\

Then run Spirit.exe again

To get Spirit.exe for Windows to jailbreak your Iphone, Ipod, or Ipad

goto SpiritJB.com 
Make sure your iPhone is on, in normal mode, and connected to the computer via your USB cable. Open Spirit – it will see your device and show it’s ready.

Select JailBreak

WINDOWS  7 FOLKS: If you’re getting error code c0000005, apparently setting compatibility mode to Windows 98 allows Spirit to work.
Your iPhone will show a “Restore Complete” screen (don’t worry, it’s not deleting any of your info/content), and Spirit will show Jailbreak Complete.

 

Allow it to reboot and run through its installer, once complete you will see your slider bar and you can access your phone. I suggest you look for and run the Cydia and install any updates with your WiFi turned on.

Spirit

Windows Vista Remote Desktop to Terminal Server Shows Black Screen

If your having an issue getting RDP client on Vist to connect to a 2003/2008 TS server you may be having issues with Vista TCP auto tuning.

To disable Vista Auto Tunning

run as an admin from cmd prompt:
netsh interface tcp set global autotuning=disabled

Then try your session again

If your having an issue getting RDP client on Vist to connect to a 2003/2008 TS server you may be having issues with Vista TCP auto tuning.

To disable Vista Auto Tunning

run as an admin from cmd prompt:
netsh interface tcp set global autotuning=disabled

Then try your session again..