Archive for category Scripts

Cause a Computer to Stop Booting via Script

Interesting simple script I wrote today to cause a computer to stop booting. When run the operating system will not load, the issue is easily reversed with a boot cd of any kind. Why would I ever want to do this you might ask. Simple I used it at the request of an employer. The boss had requested a way to see exactly what a user was doing on his work computer without a chance to clean it up. I used kaseya to push this script down and a few min later I got a call from the user saying his computer crashed. I told him to send it to IT and he did. I got the computer, renamed the file and turned it over to the boss so he could see what he wanted. He was let go a few hours later.
Read the rest of this entry »

, ,

No Comments

All About Internet Explorer 8 & Uninstall/Rollback Script

Internet Explorer 8 is the newest release from Microsoft and recently left beta and hit automatic updates. I will be discussing the issues that I have encountered, and the fixes I have found. Additionally, I will include group policy templets to prevent its distribution and a uninstall script to remove it for systems. I came in Monday to find that the software was installed on a spattering of computers across sever different clients (about 250 computers). I spent most of the rest of the week fixing them.
Read the rest of this entry »

, ,

6 Comments

Add Date and Time to any Batch File Output

This trick is useful for both troubleshooting batch file tasks and when using a batch file to create a log. For example I have a scheduled task that renames some of my backup folders at night and then moved a few files around for me. When the batch file starts I uses the below code to print the time it starts, I repeat the two lines at the end of the batch file so that I can see what time the job completed. This is useful for figuring out average time of a task so that you can schedule other things without interfering.

Read the rest of this entry »

, ,

No Comments

How to Rename a File Over a Network Through a Batch File

Sometime you need to rename a file or a folder that does not reside on your sever. For example I run a scheduled task on one sever to rename the folder on another server so that I can automatically archive backups weekly. Batch files or command line operations do not support UNC paths like \\myserver\my_share without taking some steps first.
Read the rest of this entry »

,

No Comments

Scripted Enumeration of Accounts with Local Admin Rights

Beefing up security on networks keeps you from having issues in the long run. An hour today can save you three later. In a effort to improve network security and individual computer security I came up with this fancy little kaseya script.  It enumerates the local administrators on a computer and exports them to a text file named whatever the target computer has been named. This can also be run through a batch login script. In the example below “g:” is a admin share on my local server, you can make this what ever you want or use a get file in kaseya to snatch the text file from the computer.

Read the rest of this entry »

,

No Comments

Removing Trend Micro Client/Server Security Silently Through Kaseya or a Login Script

As you might have noticed from my last post I have spent some time cleaning up Trend Micro issues on my networks this week. I have a few installs that are messed up and need a reinstall so I made this.

Script Name: Trend Micro Uninstall
Script Description: Uninstall Trend Micro client
IF True
THEN
Set Registry Value
Parameter 1 : HKEY_LOCAL_MACHINESOFTWARETrendMicroPC-cillinNTCorpCurrentVersionMisc.Allow Uninstall
Parameter 2 : 1
Parameter 3 : REG_DWORD
OS Type : 0
Execute File
Parameter 1 : c:Program FilesTrend MicroClient Server Security Agentntrmv.exe
Parameter 2 : /silent /noreboot
Parameter 3 : 0
OS Type : 0
ELSE

Read the rest of this entry »

, ,

1 Comment

Enable and Disable UAC Via Login in Vista

In Vista UAC (User Access Control) is both anoying and can prevent you for doing some tasks remotely. For example, Installing Trend Micro Client Security Agent is not possible over VNC if UAC is enabled. UAC will cause a window to pop up asking you to confirm that the drivers that the antivirus is trying to install are legitimate. When UAC is invoked you will often lose VNC to a computer, I found that this a very common issue when installing drivers in particular. In looking for a easy way to disable UAC on a few computers while doing some maintenance I found this command line chunk.
Read the rest of this entry »

,

No Comments

Change The Default Internet Explorer Homepage

I have a chunk of registry tweaks I run on new computers, this is one of them. It changes the internet explorer homepage to www.google.com, though you can use anything you like in place of google, perhaps a intranet page?

Windows Registry Editor Version 5.00 

[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMain]
“Start Page”=”www.google.com

Simple but powerful, and can be merged to the registry silently using regedit /s, or added to a list of registry hacks.

To use this with kaseya import the below script, change the red to your best practice and away you go.

Script Name: Default IE Page – google
Script Description: Set Default Page on Iternet Explorer.  

IF User Is Logged In
Parameter 1 :
THEN
Set Registry Value
Parameter 1 : HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMainStart Page
Parameter 2 : http://www.google.com
Parameter 3 : REG_SZ
OS Type : 0
ELSE

[ad]

,

2 Comments

Adding ‘Lock My Computer’ Shortcut to The Desktop

In a effort to increase security at one of my healthcare providers they requested a quick way their employees can lock their computers when they walk away from their computers.  I found Mklnk, it is a very tiny free utility that lets you make shortcuts from command line.  I decided to use this to accomplish this task.  I did some research and found that the following command will lock your computer.

rundll32.exe user32.dll,LockWorkStation

Read the rest of this entry »

,

No Comments