Carl's geek blog
Carl
This user hasn't shared any biographical information
Posts by Carl
Scheduled Backup to RDX / RD1000 with SBS 2008 and wbadmin
Dec 11th
Using wbadmin, you can back up everything, including Exchange, to the RD1000.
If you tell wbadmin to back up to the target drive directly, e.g E:, it will want to reformat the disk every time and therefore only allow one backup on the disk, and it will prompt you to allow the format, even if you gave the parameter -quiet. So instead we share the RD1000 and use a script like this:
@echo off
set Logfile="c:\network shares\company\Backup Log.txt"
rem Should be called with backup name as parameter, backup will be stored in that backup name's folder.
echo. >>%logfile%
Echo ***** Backup starting at %date% on %time% >>%logfile%
Echo Creating Backup Directory at \\server\rd1000\%* >>%logfile%
if not exist "\\server\rd1000\%*" md "\\server\rd1000\%*" >>%logfile%
Echo. >>%logfile%
Echo ***** Starting Data and System files backup >>%logfile%
wbadmin start backup -backuptarget:"\\server\rd1000\%*" -include:c: -quiet >>%logfile%
Echo. >>%logfile%
Echo ***** Starting Exchange Server Backup >>%logfile%
del "C:\Users\Administrator\AppData\Local\Microsoft\Windows NT\NTBackup\data\*.log"
ntbackup backup "@C:\Users\Administrator\AppData\Local\Microsoft\Windows NT\NTBackup\data\Exchange.bks" /a /d "Exchange Server" /v:no /r:no /rs:no /hc:off /m normal /j "Exchange Server" /l:s /f "\\server\rd1000\%*\Exchange Server.bkf"
type "C:\Users\Administrator\AppData\Local\Microsoft\Windows NT\NTBackup\data\*.log" >>%logfile%
echo. >>%logfile%
echo ***** Starting IRIS backup >>%logfile%
sqlcmd -S SERVER\IRISPRACTICE -Q "BACKUP DATABASE [IRIS] TO DISK = N'\\server\rd1000\%*\IRIS-FUll Backup.bak' WITH NOFORMAT, INIT, NAME = N'IRIS-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10" >>%logfile%
Save the script as c:\dobackup.cmd , and call as “c:\dobackup Daily Backup” or “C:\dobackup Monday” with the Task Scheduler. Obviously make sure there is enough space on your RD1000 for five backups. If not, alter the script or just call it with “Set1″ and “Set2″ instead of Monday, Tuesday, Wednesday etc.
Although it looks like there is nothing there to say “Back up the Exchange IS”, there is an “Application” entry for Exchange in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WindowsServerBackup\Application Support\{76fe1ac4-15f7-4bcd-987e-8e1acb462fb7} , and the output of the backup says “Running consistency check for application Exchange.” This confirms Microsoft’s documentation that SBS’ version of Windows Server Backup does indeed back up Exchange.
Because I am a wuss, and I have no faith, I am also doing an NTBackup of the Exchange IS to a file on the disk. The NTBackup files that you will need to run NTBackup on SBS 2008 can be found here. Extract them to C:\Windows, because there is a VSSAPI.DLL in Windows\System32 that NTBackup doesn’t like. If you extract the files to \Windows, ntbackup will use the VSSAPI.DLL in its own directory.
Overcoming CopyControl protection of old 16-bit applications with the help of XXCOPY.
Dec 11th
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.
How to clear the temp directory.
Dec 11th
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.
SBS 2008 Unbootable after partition resize – winload.exe; Status: 0xc0000225; Info: The selected entry could not be loaded because the application is missing or corrupt.
Dec 11th
The server is all done. One last thing to do – resize that Dell OS partition now that we have the Data partition on a separate 500gb RAID1.
Being an old fashioned person (read: not a Vista user, and new to SBS 2008), I didn’t think to use Disk Management to do the resize. I used Acronis Disk Director. This resulted in the system not booting, with the above error message.
I was at a bit of a loss for what to do. I ran chkdsk from an NTFS bootdisk and this made no difference. Obviously there is no boot.ini any more, and to make matters worse, the Dell supplied SBS 2008 DVDs are non-bootable, so I was a bit stuck.
Whilst waiting the 2hrs for the SBS 2008 DVD ISO to download from Microsoft.com, I thought I’d try out a Vista disk and see if that would repair the bootmgr. It did and now all is well.
The problem is apparently caused by the UUID of the partition changing, leaving the bootmgr unable to find it, as per this article.
Internet Explorer error pages blank and missing information, can’t click continue or more information.
Dec 11th
Internet Explorer 7 / 8 appear broken. Error pages such as “Certificate Error” do not display full information, lots of script errors, “more information” gives blank information, can’t click “continue” on certificate error pages (which means you can’t accept a self-signed cert).
Fix: (download subinacl first).
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f
subinacl /subdirectories C:\ /grant=administrators=f
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=system=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=system=f
subinacl /subdirectories C:\ /grant=system=f
for %a in (param1 param2 ..) do something with %a
Dec 11th
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.
Exchange ActiveSync on SBS broken due to ExchangeVdir setting in registry.
Dec 11th
This is the second time I have encountered this now. Both sites were completely unrelated and had different IT admins. In each case, for whatever reason EAS was not working, probably due to SSL problem or IP address restrictions, but in trying to fix the problem, the IT person left the machine with ExchangeVdir set to /exchange-oma, but no such virtual directory in IIS.
To fix, I simply removed the ExchangeVdir registry entry, but according to MS KB article 817379, on SBS 2003 the key should indeed be set, and a virtual directory should exist called exchange-oma. Therefore, it seems that the IT person is doing the re-build of Exchange IIS virtual directories (as per the well known MS KB article where you do the metabase edit), but the re-build does not create the SBS-only non-standard exchange-oma directory. I am guessing that the CEICW recreates the exchange-oma virtual directory, otherwise it must be manually created as per kb817379.
In any case, this is something to look for when EAS does not work. The IIS logfiles show the requests for /exchange-oma, which does not exist.
The key issue here is that in attempting to fix a problem, the IT person compounds the problem with exactly the same symptoms but a totally different cause. They probably then move on and fix the initial cause of the problem, but it still doesn’t work because they just goofed up the ExchangeVdir stuff.
The Routing and Remote Access service failed to start due to dependency service NetBIOSGroup failed to start.
Dec 11th
RRAS won’t start because service “NetBIOSGroup” failed to start.
This is due to broken “NetBIOS Interface” service, which provides “Group = NetBIOSGroup”.
Import the following .reg file and reboot the server: http://www.css-networks.com/netbios.reg
Blackberry Professional Server for Exchange quick setup.
Dec 11th
If the machine already has SQL Server or SQL Express on there, the BPS installer will not automatically create an SQL instance. You can either use an existing instance (i.e. tell the installer to create the Blackberry database on the SERVER\SHAREPOINT instance), which may confuse other sysadmins later and result in accidental removal of the Blackberry database, or you can install SQL 2005 Express yourself manually, which is what I do. It’s in the tools folder after you have extracted the BPS archive. Deselect “Hide Advanced Configuration Options” during the SQLEXPR install, and name the instance something useful like “BLACKBERRY”. You do not need User-Instances enabled.
Here’s the quick setup guide that I wrote after watching the videos. The written install guide is rotten. It makes a simple process look so tough:
Add user BPSAdmin, create Exchange mailbox.
Add to group Administrators (if you forget this you’ll know about it later when you’re unable to logon to the server locally as BPSAdmin).
Active Directory Users & Computers -> View -> Advanced Features
Domain Properties -> Security -> Advanced -> Add BPSAdmin -> Apply onto: User Objects -> Send As
Regedit: HKCU->Software->microsoft->Exchange->ExAdmin-> New DWORD ShowSecurityPage=1
Exchange System Manager -> 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.
How to remove Linux software RAID1 (md raid) on-the-fly so that VMWare Converter works
Dec 11th
Trying to do a physical to virtual conversion so that this blog can be put on the VMWare ESXi 4 box, and the little HP box can do Asterisk (VMWare didn’t play well with Asterisk).
After much frustration (need 32-bit libs on Fedora for the Converter to run), I still couldn’t quite fathom out why the converted machine failed to boot (“cannot find root”), then it dawned on me that the VMWare converter was not finding the root filesystem because it was on a linux raid1 mirror partition, which the converter doesn’t support.
Rather than transferring manually, here’s what I did:
fdisk
change partition type of RAID partition from type fd (linux raid autodetect) to 83 (linux ext). This might not be necessary, but it should prevent the kernel from auto-configuring RAID for that partition.
cd /etc
mv mdadm.conf mdadm.conf.old (i.e. remove the mdadm.conf configuration file, but keep as a backup just in case).
mkinitrd /boot/initrd-noraid-`uname -r`.img `uname -r`
(basically we’re doing “mkinitrd /boot/initrd-noraid-2.2.15-el5.img 2.2.15-el5″ if 2.2.15-el5 is your running kernel version.. the uname -r substitutes this for us.)
cd /boot/grub
edit grub.conf and change the initrd= line to /boot/initrd-noraid-x.x.x.img, change kernel boot parameter root= to reflect partition without raid, e.g. change from /dev/md0 to /dev/sda2. Do the same for /etc/fstab.
Now the initial ramdisk has no mdadm.conf, and the partition type is no longer set to linux raid autodetect (type fd).
Power down, remove one of the RAID1 disks, and the system should boot and run now off the other disk without RAID.
VMWare converter now works. Job’s a good ‘un.