Category Archives : Uncategorized
Modifying SBS 2003 SP1’s bkprunner.exe for Improved Backup Performance
http://blog.chrisara.com.au/2007/09/modifying-sbs-2003-sp1s-bkprunnerexe.html
I’ll quickly jot this down before I forget.
I’ve recently been having a shrinking backup window on one of my client’s SBS 2003 boxes. It backs up to tape and I didn’t want to create a backup script and lose the nice reporting features that SBS provides. So I hacked the bkprunner.exe process instead 🙂
On my own SBS 2003 box I was getting terrible server performance during my daily backup to USB drives. I found the undocumented /FU switch that was included with the SP1 version of ntbackup and some registry modifications that the Exchange team of Microsoft IT performed to improve their backup performance.
Open Explorer and go to "C:\Program Files\Microsoft Windows Small Business Server\Backup"
Make a copy of bkprunner.exe
Download and extract XVI32.
Run XVI32.exe
Open bkprunner.exe in XVI32
The address range $10F0-$11B7 is used for backups to .bkf files
The address range $11B8-$1277 is used for backups to tape
To turn off verify when backing up to a .bkf
Go to address $113A
In the hex pane (the middle one), type in the following hex values:
6E 00 6F 00 20
This enters in the text "no " in Unicode format.
To turn off buffered writes (as explained in MSKB 839272 and also here) when backing up to a .bkf – recommended
Go to address $115E
In the hex pane (the middle one), type in the following hex values:
46 00 55 00 20 00 20 00 20 00 20
This enters in the text "FU " in Unicode format.
To turn off verify when backing up to tape
Go to address $1202
In the hex pane (the middle one), type in the following hex values:
6E 00 6F 00 20
This enters in the text "no " in Unicode format.
Registry modifications for performance
Run regedit
Open HKEY_USERS
Load Hive
Open SBS Backup User’s NTUSER.DAT registry hive; call the key name BACKUP
Browse to HKEY_USERS\BACKUP\Software\Microsoft\Ntbackup\Backup Engine.
Edit the value of the entry Logical Disk Buffer Size from 32 to 64.
Edit the value of the entry Max Buffer Size from 512 to 1024.
Edit the value of the entry Max Num Tape Buffers from 9 to 16.
If the above keys don’t exist, create them as String values.
Click on HKEY_USERS\BACKUP
Unload hive
Display Public Folder and Other Contacts in the Address Book
A script to troubleshoot issues with Exchange ActiveSync
VBA tip: Limit the number of times a file can be opened
Using a demo of a file—not allowing it to be used more than x times
Suppose you want to send out a demo version of a file for a user to examine, but you don’t want it used more than a certain number of times, perhaps without your being paid for it. There are a lot of possible approaches for this situation, but here I’m going to show the use of some simple VBA statements called SaveSetting and GetSetting.
Here’s a screenshot of the whole procedure. It’s run each time the workbook is opened. If the VBA code is password protected, the user will not be able to easily prevent the demo program from ending.
The syntax for GetSetting is:
…and for SaveSetting is:
Each of the parameters is an arbitrary name you supply to access information stored in or read from the registry.
The AppName is more like a major category, the Section is a subcategory and the Key is yet another category. It gets clearer with the example. The first time this workbook is opened, the statement
N=GetSetting(“Demo”,”Demo”,”Demo”,0)+1 is executed. The 4th parameter is the default value given if no setting is actually already stored. So the first time, the GetSetting returns 0. Adding 1 to this stores a 1 into variable n.
So n is not 5 (yet), and it runs into the SaveSetting. The statement SaveSetting “Demo”, “Demo”, “Demo”,n now stores the value 5 in the registry. The next time the workbook is opened, the Getsetting returns that 1, and 1 is added to it and stored in n. Still not 5, and now a 2 is stored in the registry, etc. Eventually, the GetSetting returns 5, n is 6, and the program quits after giving a message to the user.
To reset this to zero on your own machine, you can either run SaveSetting “Demo”, “Demo”, “Demo”, 0, or you can run another variation of the VBA, called DeleteSetting. This syntax is:

As you can see, the Section and Key are optional. So executing DeleteSetting “Demo” clears the registry of the AppName as well as Section and Key.
Using GetSetting, SaveSetting, DeleteSetting can enable you to also communicate between sessions of Excel, or one of my favorite ways to use it is in debugging. I have frequently come across some stumpers where the VBA code crashes and I’m unable to pinpoint where that happens. This is with over 40,000 lines of VBA code (yes, a very large and intricate set of macros!). The idea of single stepping through the code is good, but there are times when I do that, then the error doesn’t occur! So I intersperse my code with random lines of something like SaveSetting “X”, “X”, “X”, 1 and SaveSetting “X”, “X”, “X”, 2 and SaveSetting “X”, “X”, “X”, 3, etc. Once the program crashes, I start up Excel and run this line in the immediate window: ?GetSetting (“X”, “X”, “X”) and if it returns 2, for example, then I know the program crashed between the SaveSetting that produced a 2 and the one that produced a 3. It has helped.
Lastly, the value stored is not limited to numbers as I’ve shown in this example—it can be any string you want, using it like a storage area for any purpose.
— Bob Umlas, Excel MVP
How to restore Administrators’ access to redirected My Documents folders
Managing the default URLs in IE on SBS 2011 Standard
Link to more information about the Program Install and Uninstall Troubleshooting Tool
http://blogs.msdn.com/b/astebner/archive/2011/11/23/10241056.aspx
There is a new general-purpose installation troubleshooting tool called the Program Install and Uninstall Troubleshooting Tool that has been available on the Microsoft support site for a little while, and I want to post some information about this tool to help make it easier for people to find it.
This tool is conceptually similar to the .NET Framework cleanup tool, but it is more generic and can be used to clean up any MSI-based installation on a computer. It also performs more robust back-up steps prior to cleaning up in case you need to roll back to a previous state.
Where to download the Program Install and Uninstall Troubleshooting Tool
You can find more information about the Program Install and Uninstall Troubleshooting Tool and download it from the following locations:
- http://support.microsoft.com/mats/Program_Install_and_Uninstall
- http://support.microsoft.com/kb/2438651
Summary information about the tool
The Program Install and Uninstall Troubleshooting Tool can be used to automatically diagnose problems that can prevent installing and uninstalling programs on your computer. It can help resolve some errors that prevent programs from uninstalling, installing or updating correctly. Here is a list of issues that this tool is currently able to fix:
- Resolves some problems that can prevent programs from being successfully uninstalled (which can block re-installations and update installation).
- Removes an incorrect registry key that can cause some installers to fail on 64-bit operating systems.
- Fixes corrupted patch data in Windows Installer registry keys.
This tool is designed as a last resort for cases where install, uninstall, repair or patch installation did not succeed for unusual reasons. It is not a substitute for the standard uninstall procedure. You should use only use this tool to uninstall a program if the program fails to uninstall using the entry in the Programs and Features control panel.
More details about how the tool works
The Program Install and Uninstall Troubleshooting Tool does the following behind the scenes when you use it to uninstall a program:
- Creates a system restore point prior to removing program files and registry entries. This restore point can be used to return the computer to the state prior to any action taken by the tool.
- Makes back-up copies of all files and registry entries that it will remove to a folder under c:\MATS\<ProductCode>.
- Backs up files in sub-folders that correspond to the system drive letters. For example: c:\MATS\<ProductCode>\FileBackup\c\…
- Backs up registry information in an XML file.
- Creates a PowerShell script that can be used to automatically restore file and registry information deleted by the tool. The PowerShell script will be located at C:\MATS\<ProductCode>\RestoreYourFilesAndRegistry.ps1, and you can double-click on it to run it if you have PowerShell installed.
- Stores additional information in the registry about actions that it has taken. This information can be found at the following location:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MATS\WindowsInstaller\<ProductCode>\<DateTime>
The most useful piece of information stored at this location in the registry is the return value received when MATS attempted to run msiexec /x to uninstall the product.
The Program Install and Uninstall Troubleshooting Tool requires Windows Installer product codes in order to know what file and registry information to remove from the computer. For programs that are listed in the tool UI, the product code will appear as a tool tip when you mouse over the product name. If you choose the Not Listed option in the tool UI, you can use a tool like MsiInv to determine the product code.
SBS 2011 Standard Additional Accepted Email Domains (Multiple Accepted Domains)
http://titlerequired.com/2011/07/14/sbs-2011-standard-additional-accepted-email-domains/
My customer is expanding his business, and is going to add a specialist arm of his company in a particular field.
As such he has setup a new website for that particular department and wants some of his staff to have a new email address based on whether they work for that part of the company.
This is really very easy to setup using Email Address Policies, and i will show you how to do that in this blog post.
I did try to get the process a little more automated, and integration into the add user wizard would have been great, but so far i haven’t got that working, but i am hoping with a little prodding of the SBS Dev team, we may be able to find a way.
To follow me through this process, you will need:
A Server running SBS 2011 Standard.
Two domains configured to send email to the SBS Server.
Some user accounts to test with..
First of all what we will do is add our new domain name as an accepted domain in Exchange.
The process for this is very similar, if not identical to that of Exchange 2007.
From Start, go to All Programs, Expand Microsoft Exchange server 2010 and open up the Exchange Management Console (EMC).
When the exchange console opens, expand Microsoft Exchange On-Premises, expand Organization Configuration and select Hub Transport.
Switch to the ‘Accepted Domains’ tab.
This shows you the current accepted domains.
On the right hand side, select ‘New Accepted Domains’
Enter a name for your new domain, and enter the domain name itself. We will leave the server as the authoratative server for this domain, click New,
After a few seconds, the action will complete, and you will be shown the PowerShell command that would have performed this action from the exchange shell. Click Finish.
You can now see your additional domain added as an accepted domain.
If we now switch to recipient configuration, and the mailbox section, we can see our current mailbox users.
If we go to the properties of one of these accounts, we can see the current email addresses associated with that account.
We can see that no changes have been made to this account so far.
That’s good because it means existing users are not affected by what we have done.
We will have a look at existing users in a moment, but first let’s add a new user to the system.
Since i am listening to The Beatles at the moment, i am going to call this guy John Lennon. My Favourite Beatle happens to be George, but that isn’t relevant. Why then am i not calling him George Harrison, well i don’t know.
I am not covering the add user wizard here as other posts exist out there on how to do this. Plus it is in the books relating to SBS 2011.
So John, is a good guy and he’s working for my company’s new department.
But wait, as we can see here, he still has an SBSTIPS.co.uk address, not TITLEREQUIRED.com – that is good, that is what is expected.
Now, we need to edit his account.
Let’s open up ADUC (Active Directory Users & Computers) From Start, go to Administrative Tools, and you will see ADUC at the top.
Expand Yourdomain.local and keep expanding down until you find MyBusiness\Users\SBSUsers
Find John’s account, and go to the properties.
Switch to the ‘Organization’ tab, and enter ‘Titlerequired’ into the department field.
Click OK to save this change, and close ADUC.
Switch back to the EMC
Go back to the Organization Configuration, Hub Transport area, and go to the ‘Email Address Policies’ tab.
You can see we have 2 current policies. The Windows SBS Email Address Policy is set to make whatever domain name you entered in the Internet Address wizard the default for all users.
So we want to add a new Email Address Policy. On the right click, New Email Address Policy.
We need to enter a name, and also select the container where this policy should be applied, and also the type.
You can leave these as default values, but please do enter a name. Click Next.
Put a check in the box for ‘Recipient is in a Department’ under Step 1.
Under Step 2, select the hyperlinked word ‘specified’ and enter our department name value of Titlerequired.
You can then click Preview, and the policy will show you which users or recipient types it will affect. Hopefully we will only see Mr. Lennon’s name.
We do! That is great because it means whatever we are doing here will only affect that one account.
When you are happy click next.
On the email addresses page, click Add.
Here we choose how the new email address should look, i like to use first initial and surname, so i will select that.
The default is to add a new email address to the ‘default’ domain, since this is yourdomain.local the new address for John would be jlennon@sbs.local – we want to add this to our new accepted domain, so we must choose to specify the accepted domain.
Click the radio button for that option, and click Browse.
You will then see all the domains we have setup on our system.
Double Click the domain you want to use, and it will be added to your policy.
Click Ok.
You will now see your email address shown, using the variables that are used for whatever name format of address you chose. More on that here.
The table below is taken from the TechNet website and shows variables you can use.
Click Next.
You have the option to apply the new policy immediately, or at a scheduled time, or not to apply it all. We want to do it immediately, so click next.
You will see a summary page with some PowerShell commands listed. Click New to build and apply the policy.
The policy is built and applied successfully.
Lets switch back to our Recipient area, and check the email addresses our users now have.
We can see that our user still has his old address.
Switching back to the Policies area, we can see our new policy has a priority of 2, and the Windows SBS policy is set at 1.
We need to change it to priority 1. Select your new policy and on the right hand side, click Change Priority, and enter the number 1, Click OK to save.
It now jumps to the top of the list.
Now we need to reapply the policy. Right click the policy and click Apply. We get those same options as before, click on Next, and Apply.
Again you are shown some PowerShell, and you can click Finish to close the Apple Policy page.
Switching back to Recipient Configuration, you can now see that John has a new email address. (you may need to refresh the view)
IF we go into his account properties you can see he now has an email address for both SBSTIPS.co.uk and TITLEREQUIRED.com but that TITLEREQUIRED.com is his default address.
If we want to move an existing user to a new department, just edit their AD account to change their Department, and then reapply the policy.
You can see that the email address is added as an additional address.
And that is how to add an additional domain name and have it apply to only certain users.
If you want to have an additional domain apply to all users, but not as the default, then simply don’t narrow your Email Address Policy by using a department as in Step 1 and 2 above, and leave the policy at priority 2.
You can always use the Preview button to help confirm who will be affected by such a change.
If you want to change the default domain for all users, you should run the Internet Address Wizard and add your new domain here, then add your old domain as an accepted domain, and build a policy as described here to add that old domain as an additional address.