Showing posts with label Windows Server 2003. Show all posts
Showing posts with label Windows Server 2003. Show all posts

Thursday, March 13, 2008

Backup SQL databases to network share

To be able to backup databases to a network share, the MSSQLSERVER service needs access to the location on the network.
For this you need to change the SQL services service account.
Before doing this you'll need to give that user extra permissions, to accomplish this you can add the user to all the SQLServer2005* or SQLServer2008* groups.

To change the logon user go to "SQL Server Configuration Manager". Under Services, click on properties for the MSSQLSERVER.
Here you can change the logon account to the one you'll need. Specify this to a domain user, or a local user that also exists on the machine where you will store the databases, and that has the full access share and NTFS permissions.
After modifying the logon name, you'll have to restart the service. Do the same for the SQL Server Agent.

Now you'll be able to backup databases to a network share and specify the path like this then: \\servername\share.

Friday, February 29, 2008

Reset lost administrator password in Windows Server 2003

While you can use tools like ophcrack to recover your password, these don't always work and in case of strong passwords you'll need to pay for the rainbow table sets, the free included set can only crack alphanumerical passwords up to 14 characters. There is a rainbow table set that will crack passwords up to 33 characters, look on the website for the updated information and prices.

To reset your password you can use tools like the Winternals boot cd, which includes the locksmith tool.
In my experience this doesn't always work, and you have to manually add device drivers to the boot cd. If you work with different types of servers, that come with new types of RAID controllers every x months, it can become hard to keep track of. Not that you loose a password that often, but it can be frustrating when you are in urgent need of such a tool :).

The tool that I have recently found seems to be working great. The password reset did not work, but I was able to set a blank password, logon, and reset the password using computer management.
It's called "Offline NT Password & Registry Editor", visit its website and download it here.
This tool includes a lot of recent raid controller drivers which is necessary, so it detects your Windows installation partition.

Before using this tool, be sure that Windows was shutdown properly, or you will not be able to perform any actions!
If that's the case, the tool will warn you and you'll have to reboot in safe mode, and perform a clean shutdown twice.
Besides that, the tool is pretty self-explanatory, but the author has also written a walkthrough.

I was able to set a blank password on a Windows Server 2003 x64 edition with this tool, which was a great help!
As always, keep in mind that resetting a password can cause problems if not used carefully, for example in cases where EFS is used, those files will become inaccessible.

Thursday, December 6, 2007

Add windows components on Virtuozzo for Windows fix

I ran into this issue while using Virtuozzo 3.5.1 SP1 on Windows Server 2003 SP1 Datacenter Edition x64.
When creating new virtual private servers most default components are already installed, but when you want to add extra windows components (add/remove software -> windows components), you bump into this error:

Setup library wssoc.dll could not be loaded, or function StorageServerSetupProc could not be found.
The specific error code is 0x7e.


There is currently no fix available for this, it will be solved in Virtuozzo 4.0.
You can however fix this yourself by creating a new custom application template, using the virtuozzo template creation wizard. Choose to create a template from manually selected data, be sure to have created a temporary VPS already, you'll need to enter the vps id, and desired template name.
When prompted which files you want to include, add these:
c:\windows\system32\wssoc.dll
c:\windows\system32\hpcoc.dll

Finish the wizard, then run the command "vzpkgdeploy -i <templatename>" to enable this template.

Friday, November 16, 2007

Automate Virtuozzo backups on Windows

There is currently no GUI option to automate Virtuozzo backups, although not in current version 3.5.1 SP1.
This will be possible in Virtuozzo 4.0, which is currently in beta.

I'm using 2 bat files to script the backups and remove the oldest backup.
The first script creates a full backup of all virtual private servers using the vzbackup command:

for /F "skip=3 usebackq tokens=*" %%i in (`cmd /c "vzlist -ao veid"`) do (cmd /c "vzbackup "%%i && echo VE ID %%i has been backed up!)

To be able execute the second script you need to download RmEmpty, an executable which allows you to remove empty directories, get it here

First, we'll have to search the destination folder on the backup node for files older then x days, in this example I use 4 days.
forfiles /P e:\vz\backups /S -D -4 /c "cmd /c del /q @file"

The forfiles is a default windows binary, some information about the given variables:
/P indicates the path to start searching
/S instructs forfiles to recurse into subdirectories
/D selects files with a last modified data less than or equal to (-)
/C indicates the command to execute for each file
The /q is to delete the files quietly, otherwise it will ask for a confirmation before deletion.

After deleting the files we'll search for empty directories, and remove them:
C:\system\rmemp12\RMEMPTY.EXE e:\vz\backups\

Be aware that if e:\vz\backups\ itself is also empty, it will remove that one too! So always keep at least 1 file in that directory, I use a simple readme.txt so it never gets deleted.