Startup scripts – add windows features

Quick update for January!

It is easy to control Windows 7 features by turning them on and off by startup scripts. Pop along to your group policy and add the following script to add the Games features back into Windows 7 Enterprise (default is not to install games – how boring!)

REM Install Games
dism /online /enable-feature /featurename:"InboxGames" /norestart /quiet

You can control any features with this simply look up the featurename of the component you want to use.

View your currently installed features with:

dism /online /get-features

You may want to pipe that to something as it can be a long list!

Manage Windows Printers from command line script

Every now and again you come across the issue of printers…..

Most people in larger environment will use Group Policy to manage your printer deployment, certainly in Windows Vista/7 this was made a lot easier with the enhancement of group policy.

This script was included with Windows XP and has appeared in subsequent versions of Windows.

C:\>cscript %windir%\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs /?
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Usage: prnmngr [-adxgtl?][c] [-s server][-p printer][-m driver model]
               [-r port][-u user name][-w password]
 Arguments:
 -a     - add local printer
 -ac    - add printer connection
 -d     - delete printer
 -g     - get the default printer
 -l     - list printers
 -m     - driver model
 -p     - printer name
 -r     - port name
 -s     - server name
 -t     - set the default printer
 -u     - user name
 -w     - password
 -x     - delete all printers
 -xc    - delete all printer connections
 -xo    - delete all local printers
 -?     - display command usage
Examples:
 prnmngr -a -p "printer" -m "driver" -r "lpt1:"
 prnmngr -d -p "printer" -s server
 prnmngr -ac -p "\\server\printer"
 prnmngr -d -p "\\server\printer"
 prnmngr -x -s server
 prnmngr -xo
 prnmngr -l -s server
 prnmngr -g
 prnmngr -t -p "\\server\printer"

A couple of handy commands to get you started

Remove all network connected printers:

cscript %windir%\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -xc

If you prefer your approach to be a little more precise, then below is the script I use for removing particular printers and their drivers from machine. Also a very handy way for dealing with 64 bit and 32 bit Windows printers….

rem Remove all Kyocera Drivers
 rem Check Environment
 IF NOT "%ProgramFiles(x86)%"=="" (goto ARP64) else (goto ARP86)
 REM 64 Bit
 :ARP64
 cscript %windir%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -d -m "Kyocera FS-2020D KX" -v 3 -e "Windows x64"
 cscript %windir%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -d -m "Kyocera TASKalfa 500ci KX" -v 3 -e "Windows x64"
 goto End
 REM 32 Bit
 :ARP86
 cscript %windir%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -d -m "Kyocera FS-2020D KX" -v 3 -e "Windows NT x86"
 cscript %windir%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -d -m "Kyocera TASKalfa 500ci KX" -v 3 -e "Windows NT x86"
 goto End
 :End

Outlook profile moving

Have you ever noticed that some users complain?

Outlook seems to be the most popular email client in the business world, however if you have users on one machine they usually want to have there settings on all machines. Roaming profiles is ideal for this however there are always times when you have to do it manually.

The most common bug bear from users is when you move ore re-create their profiles on another machine, outlook has “forgotton” then email contacts. ie Quick list that drops down when you start to enter an email address.

The reason for this is that this information is held in a file within the users folders, not in the PST file (if you are using PST), or Exchange.

To find this file you are looking for a file with the extension .nk2 the full name will be the Outlook profile name with the extension .nk2.

This file can usaually be found in:

Windows XP
Drive:\Documents and Settings\Username\Application Data\Microsoft\Outlook
Windows Vista and later versions
Drive:\Users\Username\AppData\Roaming\Microsoft\Outlook

If you have changed the profile name in Outlook when you set up the new account simply change the name of the .nk2 file to match.

NOTE that Outlook 2010 now stores this information inside the PST or Exchange mailbox. If you want to import these see the following link:
http://support.microsoft.com/kb/980542

 

Microsoft DPM RPC connection issues

I have be using Microsoft Data Protection Manager for a while now and really like it.

One tiny little problem that came up which kept us from replicating all of our data to a remote DPM server was the rpc errors that kept appearing.

We use Forefront Threat Managment Gateway, formerly ISA server, and were having this problem until the solution was successfully found!

The problem lies with Strict RPC compliance in the FTMG (ISA). You need to remove the check box from enforce strict RPC compliance. See the following blog from Microsoft for a complete run down:

http://blogs.technet.com/b/isablog/archive/2007/05/16/rpc-filter-and-enable-strict-rpc-compliance.aspx

Error 0x800f0818

Recently when trying to update a Windows Server 2008 R2 machine with service pack 1, I came across this error  0x800f0818 which made the update fail.

Also the error seems to be relevant on Windows 7 and Server 2008. Corrupted update files seem to be the order of the day. Server Manager will also show the error and refuse to refresh often with 0x800f0818 and 0x800b0100.

The fix to this is the Microsoft Update Readiness Tool, which can be downloaded from: http://support.microsoft.com/kb/947821

See this technet blog article for moer information about running the tool:

http://blogs.technet.com/b/roplatforms/archive/2010/05/12/how-to-fix-server-manager-errors-after-installing-updates-hresult-0x800f0818-hresult-0x800b0100.aspx