Archive for the 'Tips & Tricks' Category

Blackberry Professional Server for Exchange quick setup.

Add user BPSAdmin
Add to group Administrators

AD Users & Computers -> View -> Advanced Features
Domain Properties -> Security -> Add BPSAdmin -> Apply onto: User Objects -> Send As

Regedit: HKCU->Software->microsoft->Exchange->ExAdmin-> New DWORD ShowSecurityPage=1
ESM -> Right-click Org -> Delegate Control -> Next -> Add BPSAdmin -> Exchange View Only Administrator
Right-click Org -> Properties -> Security -> BPSADmin -> Allow Administer IS, Receive As, Send As.

Log off.

Log on as BPSAdmin

Start BPS setup, accept all defaults, enter the BPSAdmin password.

Set up device as usual - Options -> Advanced Options -> Enterprise Activation.
When entering the email address, use space bar instead of @ and dot.

Overcoming CopyControl protection of old 16-bit applications with the help of XXCOPY.

Old hard drive is E: (mounted through USB to IDE adapter)

New system is C:

C:

cd \

mkdir Application

xxcopy e:\Application c:\Application /clone /TC

Since CopyControl relies on the created/modified/accessed timestamps of the files within the hidden/system control directory of the application, the above will preserve them and CopyControl won’t be aware that the application has been copied to a new computer.

The /TC flag to XXCOPY causes it to preserve the file created, modified, and accessed timestamps, to the exact second. Whilst transferring Recruit to a new server late one evening a couple of years ago, I experimented and discovered that this was how the protection scheme (CopyControl) detected tampering/copying. At that time I used a tool called 12Ghosts FileDate or something, but XXCOPY does all this for us now. I am in the process of migrating five computers in a leasing company and am using this quick and easy procedure for transfering the DOS based quoting system which also uses CopyControl.

Some example applications: Oxford Software’s Recruit, LeasePlan / Network Lease’s Ultinet quoting system.

You can tell the application uses CopyControl because there is either a local or network folder which contains a hidden/system folder named something.NNN where NNN is some numbers, e.g. 489. Within that folder are some more files, one called something.CCC and also a file called CCONTROL.

This CopyControl is not the same as the one used by the music business on audio CDs.

When adding a printer / installing driver “The RPC server is unavailable”.

This is due to the print spooler service not running, or dying during the install.

You may also find that the print spooler service frequently dies - “spoolsv.exe has encountered a problem and needs to close”, or the Printers and Faxes folder frequently appears empty - i.e. all your printers are missing.

NetSupport Manager or NetSupport PC Duo version 8 on Windows XP SP2 will cause this to happen. Update NetSupport and all will be well.

It is possible to save the password on XP / Vista Home Edition for Outlook working via RPC/HTTP.

It is possible to stop Outlook prompting for the user’s password when using RPC/HTTP (Outlook Anywhere / Outlook via Internet) on a client running Windows XP Home or Vista Home Edition. We already know how to do this on XP Pro/Vista Business, even if the XP Pro/Vista Business machine is not joined to the domain, by using “Manage Network Passwords” within User Accounts.

Home Edition of Windows does not have the ability to either join the domain, or save network passwords, so we have to configure the workgroup-based machine as if we were trying our best to integrate it into a domain environment.

As per my previous article, lmcompatibilitylevel was set to 2, mutual-auth not enabled, NTLM authentication, and the certificate was imported to the “trusted root certification authorities” store.

The Home Edition client was configured as if it was to be accessing a server in a domain. That is:

  • Workgroup name was set to the netbios domain name of the company (OURDOMAIN)
  • The user account name was the same as the user account in the domain. If this does not match, simply changing the account name in User Accounts will not suffice. All that does is change the “Full Name”, not the Username. It needs to be either done through “Local Users & Groups” within Computer Management (if that exists on Home Edition.. ?), or a new account must be created with the name exactly as the username on the domain.
  • The user’s password on his Home Edition client was set to the same as on the domain. The user was instructed not to change his password.

The two users are not being prompted for their password when launching Outlook outside of the office. It’s been a couple of weeks now since I set them up.

for %a in (param1 param2 ..) do something with %a

This is useful. The params can be a filespec, e.g. “*.pdf”, or they can just be values given on the command-line.

Let’s say you are remotely accessing a computer, and you want to release and renew its IP address. When you release the IP address, you’ll lose connectivity and won’t be able to renew. You could make a batch file, or you could do:

for %a in (release renew) do ipconfig /%a

This will run “ipconfig /release” followed by “ipconfig /renew”.

Or let’s say you have a thousand home directory folders, and you set the permissions a bit wrong. You want each user to have full control of their own folder. You could do:

for /D %a in (*) do cacls %a /E /G %a:F

This will run “cacls carl.farrington /E /G carl.farrington:F”, substituting carl.farrington for the folder name and user name until every folder has been done. This example assumes of course that the folder name is the same as the user name who you want to grant the permissions to. Notice the /D - this means the filespec matches directory names, not filenames. Without the /D the * would not return any directory names.

Another example. You might want to search within every .ini file in the current directory. NT’s “find” command doesn’t accept wildcards/multiple files. So what you do is use a for loop and pipe the output into a text file that you can check when the process completes:

for %a in (*.ini) do find /i “Microsoft” %a >>output.txt

This will do “find /i “Microsoft” file1.ini >>output.txt”, then file2.ini, then file3.ini. You can check the output of output.txt to see which files contained the text you were searching for.

I sometimes use this to search all the oem*.inf files in %windir%\inf to find the inf file that’s supplying driver information for a particular piece of hardware. Then I can delete that inf file, remove the hardware from device manager and Windows will not just re-install the existing driver for the device, allowing you to supply a different driver. Searching for the INF file is not necessary on Vista because the details tab in a device’s properties within Device Manager has been extended to display the inf source.

“Publisher cannot complete the operation”, on Windows XP.

Contrary to the Microsoft Knowledgebase article, my encounter with this problem was caused by an overloaded Temp directory on the user’s computer. See How to clear the temp directory.

How to clear the temp directory.

This is such a simple thing that nobody would ever consider writing a blog entry or howto about it, right? The thing is though, I frequently see IT support technicians using Windows Explorer, clicking through into the user’s temp folder, highlighting everything and attempting to delete. They are interrupted (and the process aborted) by a message stating that a particular file was in use and could not be deleted, so they de-select that one file, and try again. Some more files are deleted but once again they are interrupted and told that another file couldn’t be deleted. They de-select that file and try again. This can go on for ages..

Here’s how to do it properly.

Go to a command prompt (Start -> Run -> cmd [enter])

At the command prompt type:

cd %tmp%

and press enter. This will change you into the current user’s temp directory.

Then type:

rd /s .

(that’s rd space slash-S space dot)

then press enter. Don’t forget the . at the end. This means “remove the current directory and all subdirectories, including all files.”

What will happen is that the contents of the temp directory and all subdirectories will be removed, but not the temp directory itself, because you are currently working in that directory (via the CD command) and therefore it can’t be deleted.

You’ll receive access denied messages for all in-use files, plus the temp directory itself. That’s fine. Those access denied messages would have been showstoppers if you were using Windows Explorer.

The above is clearing out the current user’s temp directory, which is located within that user’s profile directory (Documents and Settings\username). To clear out the system temp directory, which is located under the Windows directory, type:

cd %windir%\temp

and press enter. This will change you into the Windows temp directory.

Then just like before, type:

rd /s .

All done! You can type “exit” to close the command prompt.

Recovering from Windows registry hive corruption, the clever way.

I like this trick. Every time I do it, I think about all those people doing repair installs (in-place upgrades).

It works pretty much every time unless the filesystem is really truly screwed, in which case you need a backup, say from the system restore directory (System Volume Information), as per this knowledgebase article (don’t bother with the recovery console though, use your USB to IDE or USB to SATA cable and fix it from your laptop.)

Here are the symptoms. You try to start up your Windows 2000/XP (Vista too?) computer and you get a message, white text on black background:

Windows could not start because the following file is missing or corrupt: \WINDOWS\SYSTEM32\CONFIG\SYSTEM

or

Windows could not start because the following file is missing or corrupt: \WINDOWS\SYSTEM32\CONFIG\SOFTWARE

Sometimes, the message is cut short, so you might see “\WINDOWS\SYSTEM32\CONFIG\SYS” or similar. Hint: If it’s really cut short, and you can’t see if it’s SOFTWARE or SYSTEM, do the following procedure on both files. Whichever one is identified as having been repaired, well that’s the one that was broken ;)

Anyway, how to fix it in 2 minutes:

Use your USB to IDE/SATA adapter cable, and connect the broken machine’s hard drive to your laptop, or your spare PC or whatever. You don’t have to use a USB to IDE/SATA adapter cable - if you’re a person at home with another PC you can stick the drive on a spare IDE or SATA channel. You just need to get that hard drive into a working Windows XP computer for a few minutes.

Windows will mount the broken computer’s hard drive as, say E: or F:. Make sure you have your computer set to show hidden files and also system files. To check this, go into My Computer -> Tools -> Folder Options, -> View Tab, and select “Show hidden files”, and make sure “Hide protected operating system files” is not ticked.

First things first, run chkdsk on that drive, after all it is most likely filesystem corruption that has caused the registry to become corrupt in the first place. In My Computer, right-click the broken computer’s drive and choose properties. Go to tools, “Check Now”, put a tick in only the first box (Automatically fix filesystem errors), and click start. Let that finish before continuing.

Here’s where the magic happens. Go to start -> run, and type regedit [enter]. This will launch the registry editor on your computer. In the registry editor, highlight HKEY_LOCAL_MACHINE, and then go to File -> Load Hive. Find the file that is “missing or corrupt” (from your error message earlier), and choose to load that. It will be in E:\(or F:\)Windows\System32\Config, and will be called just SOFTWARE or SYSTEM. Regedit will ask you to name the hive, just type “badpc” (any old garbage will do - it’s only temporary).

Regedit will say “One or more files containing the registry were corrupt and had to be recovered by use of log files. The recovery was successful.” You have just repaired the registry! Now you need to Un-load that hive, so highlight that “badpc” hive that you can now see under HKEY_LOCAL_MACHINE, and go to File -> Unload Hive.

You now just need to put that hard drive back in the broken computer, which hopefully won’t be broken any more! If you used a USB to SATA or USB to IDE cable from your laptop, make sure you use the “Safely remove hardware” icon in the system tray next to the clock to safely remove the hard drive, else you may cause filesystem corruption again. Alternatively just shut your laptop/working computer down properly and remove the hard drive once it’s shut down.

All done.

Some background:

The registry is a database. It has transaction log files which can be used to recover from corruption. It would appear that the early Windows boot process is not able to work with those log files, but regedit (and Windows itself further on in the boot process) is.