Thursday, December 15, 2011

Enabling scripts in Windows PowerShell

Ok, so you've written your own script and now you want to run it to make sure that everything works fine. So you load up Powershell and try to run it but it gives you an error saying that the "execution of scripts is disabled" on your system. Now that's not very nice. But its ok, its very easy to fix.

First load up powershell as an administrator. Then type in

Get-Executionpolicy

What is should return is a value of Restricted

Now type in

Set-Executionpolicy unrestricted

And that's it. You can type in the get-executionpolicy again just to make sure but you should now have the ability to run scripts.

Wednesday, November 23, 2011

Deploying K-Lite Codec pack with Group Policy

I was asked to deploy the K-Lite codec pack recently. Deciding that it probably wasn't the best idea to go round and install it on each computer individually I decided on using Group Policy.

Now K-lite doesn't come as a MSI file, so that route was out but luckly the makers have set up a way to run an unattended install. Here's how you can do it too!

1) Download the K-lite pack from Here

2) Once downloaded Run the downloaded exe-file with the -Makeunattended switch and follow the on-screen instructions exactly

3)You will see that the once you have followed the instructions you will have 2 new files in the same directory as the exe-file. It should be a .Bat file and a .ini file.

4)Now logging in to your AD server, create a new Group Policy and call it something obvious. Now open up the GPO go to Computer Configuration/Policies/Windows Settings/Scripts/Startup

5)Click add, and then browse. Now you need to copy the three files from earlier (the installer, the bat file and the ini file) to the folder that has just opened up. Then select the .Bat file and click open, ok and ok again.

6) Apply the GPO to the container with the computers in that you want it install on.

7) Go for a well deserved drink!

Tuesday, November 22, 2011

Print Spooler Service Keeps Stopping in Windows 7

There have been a couple of instances at work of computers losing the ability to print. Not only this but they can not add or remove printers as well. The error that comes up may be familiar to some of you.


So we tried to restart the print spooler service, which it did without error, and then go back and add the printer again, and guess what... the same error popped up. Dont you just love computers.

After quite a lot of investigating we found the cause. In the registry there are duplicate enteries for the same driver. If you delete one of them the print spooler will be fine.

Note: Making changes to the registry can mess up your computer. Make sure you take a full backup of the Key you are changing before you make the changes!

So first, open command prompt with Admin priviledges and type in

net stop spooler

This will make sure that the print spooler service is stopped.

Next open the registry up and go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-3

Under this you will see a list of all the drivers currently installed on your system. If there are any duplicates you can just delete one of them.

Now go back to the Print key and below it you will see a Printers key. Under this are all the printers that are installed. Again if there are any duplicates, just delete one of them.

Now close the registry and go back to your command prompt. Type in

net start spooler

And this should have fixed your problem.

Friday, November 18, 2011

The User Profile Service failed the logon. User profile cannot be loaded

We've been having a few problems with this error at work lately. Its very annoying as it doesn't affect all the users. It looks like its about to let you on and then kicks you straight back out again. After a lot of investigating we found serveral ways to fix this problem.

The first being the way Micosoft want you to fix it. They have a few soloutions on this webpage

They even provide you with a nice 'fix it' MSI file that you can roll out with group policy.

The second way to to delete certain files in the 'default' profile under your C:\USERS\ area. Its probably hidden so you will need to 'show hidden files or folders'

In the C:\Users\default profile you have the usual NTUser.dat and NYuser.dat.log file. You may find that there are other NTuser files with strange names. You need to delete these and just keep the original .dat files. Then give it a restart and it should work.'

Another option is to do a system restore. Now if you work in a domain environment you may have this turned off through group policy. If so that is not an option.

The last thing you can try is a complete re-image of the computer. This will obviously work, but takes the longest.

Tuesday, November 15, 2011

Audio Device is Disabled

Recently we've had a problem with some computers not producing sound. When running the troubleshooter that Microsoft provides its tells you that an "Audio Device is Disabled." But not how to re-enable it. So this is how.

First Option

First, right click on the speaker icon in the notification area (which probably has a small red cross on it) and choose 'playback devices'

Now you should see a speaker icon in the middle of the box that has just opened. Under this right click and one of the options you will be presented with is to show disabled devices. Click this and if any device is disabled, it should appear. You may also have to check the Recording tab at the top. You can then right lick on this device and select 'enable'.

Second Option

If this doesn't work, or it keeps crashing when you try it, then it may be a permissions problem and you should try this.

Click start and type in cmd in the search area. Once found right click on the program and choose 'run as administrator'. The command prompt will now open and you should type this in.

net localgroup Administrators /add networkservice
Press Enter
net localgroup Administrators /add localservice
Press Enter and then restart your computer.

This should have fixed the problem for you.

Thursday, November 03, 2011

Temporary Files Deleter

Ok, here is a very simple temporary file deleter. It uses the most common places that the system keeps temp files and deletes specific types. Feel Free to edit it to include other places as well. So as normal copy and paste into a notepad file and save as a .bat

@echo off
cd\
:: User temp files
del "%TEMP%\*" /F /S /Q

:: System temp cache
del "%WINDIR%\TEMP\*" /F /S /Q

:: User history and temp files
del "%SystemDrive%%HOMEPATH%\Recent\*.*" /F /Q
del "%SystemDrive%%HOMEPATH%\Local Settings\Temp\*.*" /F /Q
del "%SystemDrive%%HOMEPATH%\Local Settings\Temporary Internet Files\*.*" /F /Q
del "%SystemDrive%%HOMEPATH%\Local Settings\Application Data\ApplicationHistory\*.*" /F /Q
del "%SystemDrive%%HOMEPATH%\My Documents\*.tmp"
del "%SystemDrive%%HOMEPATH%\My Documents\*.bak"
del "%SystemDrive%%HOMEPATH%\My Documents\*.log"

:: complete
exit

Wednesday, November 02, 2011

Free Security Tools

So today im going to list you what I think are the best FREE security programs on the market.

Anti-virus: 
Avast! 
Microsoft Security Essentials 
Avira AntiVir  
AVG Anti-Virus 

Anti-Malware: 
Ad-Aware
Spybot S&D
Windows Defender
Anti-malware toolkit
Online-Scanenrs:
Virustotal (Uploader)
Novirusthanks (Uploader)
Viruschief

FireWalls:
Comodo
Privatefirewall
PCTools
Jetico

Ok, that should get you started. We'll talk about security and other ways to protect yourself at some other point, but with this list you have a great place to start.

Tuesday, November 01, 2011

Forwarding Multiple Emails in a single Email - Outlook 2010

If you have a load of email you need to send someone but don't want to send them one by one, and you dont want to clutter your recipients email up you can add all of them as attachments in one single email. Its very simple to do so here you go.

1. Launch Outlook 2010.
2. Select the emails that you want to forward by holding Ctrl and clicking on the emails.
3. Go to the 'Home' tab and choose 'Forward'.
4. Fill in all the necessary information and hit Send. (All your emails will be attached)
5. Your recipient will receive all attached emails in one single mail.

Monday, October 31, 2011

Change Target of Task List Explorer Icon to My Computer

If you are running windows 7 and hate the "Libraries" default on your task bar, here is how to change it to default to "My Computer"
  • Right click the icon for Windows Explorer on the task bar.
  • Right click Windows Explorer
  • Left click Properties
  • Set the target to be:
    %SystemRoot%\explorer.exe /root,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
The icon will now default to the My Computer menu instead of libraries.
 

Computer running Check Disk every time you start up

If during startup, you always get a message that says a drive it broken and Windows needs to run CHKDSK on it, you allow the CHKDSK to proceed, but then get the same prompt every time you reboot, try these steps:

In the following, replace 'e:' with the drive letter that is having this problem on your machine:

1. Click on your start menu and open the run dialog.
2. Type "cmd" and press Enter (note: don't enter quotes).
3. Next type "fsutil dirty query e:".
4. If the return message indicates that the volume is dirty go to step 5.
5. Next type "chkdsk e: /f /x".
6. After that finshes repeat step 3.
7. If it is no longer dirty then reboot and you should notice no more ckdisk

Friday, October 28, 2011

Reset Local Security Policy

Today im showing you a very simple .Bat file to reset your local security policy.

Have you ever logged on to a computer as the administrator but been told that you dont have admin priviledges. I have!

So this simple command resets the local security policy to default.


echo off
c:
cd\
secedit /configure /cfg %windir%\repair\secsetup.inf /db secsetup.sdb /verbose
shutdown -r -t 10
pause

It can take a little while but has worked everytime for me. After it has done it, the computer will restart. If you dont want it to do this (it needs to for it to take effect) then you can just delete the line that starts with 'shutdown'

Thursday, October 27, 2011

Automate Registering Windows 7 and Office 2010

If you still not using a KMS server you will need to manually register all your windows 7 computers.
Here is a very simple bat script that will allow you to do that.
First you will need to be logged on with admin priviledges, have internet access, and run the .Bat file as administrator.

The command is very simple. It is

echo off
slmgr -ipk YOUR-PRODUCT-KEY
slmgr -ato
exit

Right, Now for Office 2010. The command is

echo off
c:
cd "c:\program files\microsoft office\office14"
cscript ospp.vbs /inpkey:YOUR-PRODUCT-KEY
cscript ospp.vbs /act

That's it. The -ipk changes your product key to what ever you specify. (you'll need to put the dashes in eg 1234-123-1234). The -ato activates the new key. The same applies for office 2010, except with /inpkey and /act

That's it. You can automate this through group policy, log on scripts or simply double clicking the file. Easy