exchange backup and restore API

Hi

I am following the msdn step by step with trying to backup my exchange
server, but I get an access denied error while trying to call
‘HrESEBackupPrepare’ … I am running as an Administrator on the and the
server is on the local mahcine… w2k3 … exchange 2003…

here is my code:

#include <windows.h>
#include <esebcli2.h>
#pragma comment( lib, “esebcli2.lib” )

#include

int main()
{
BACKUP_NODE_TREE *BackupNodeTree;
HRESULT Result;
Result = HrESEBackupRestoreGetNodes( L"localhost", &BackupNodeTree);

INSTANCE_BACKUP_INFO *BackupInfo;
unsigned long InstanceInfo = 0;
HCCX Handle;
Result = HrESEBackupPrepare(
BackupNodeTree->pChildNode->wszName,
L"Microsoft Information Store", //,
&InstanceInfo,
&BackupInfo,
&Handle);

// Result is “Access is denied” <--------

ESEBackupRestoreFreeNodes( BackupNodeTree );
return 0;
}

Is there any special preveleges that I should set to the user account? I
am pretty sure there shouldn’t be anything wrong, because NTbackup works
fine with getting the storage groups…

Thanks in advanced.

Daher Fawares.</esebcli2.h></windows.h>

Daher,

you wrote on Thursday, July 14, 2005, 04:37:58:

D> I am following the msdn step by step with trying to backup my
D> exchange server, but I get an access denied error while trying to
D> call ‘HrESEBackupPrepare’ … I am running as an Administrator on the
D> and the server is on the local mahcine… w2k3 … exchange 2003…

[snip]

D> Is there any special preveleges that I should set to the user account?

Actually, I would try granting the backup privilege (SE_BACKUP_NAME),
yes … :slight_smile:


Ralf.

Yes, Thanks a lot. works perfectly now…

Daher

On Wed, 2005-07-13 at 20:24 +0200, Ralf Buschmann wrote:

Daher,

you wrote on Thursday, July 14, 2005, 04:37:58:

D> I am following the msdn step by step with trying to backup my
D> exchange server, but I get an access denied error while trying to
D> call ‘HrESEBackupPrepare’ … I am running as an Administrator on the
D> and the server is on the local mahcine… w2k3 … exchange 2003…

[snip]

D> Is there any special preveleges that I should set to the user account?

Actually, I would try granting the backup privilege (SE_BACKUP_NAME),
yes … :slight_smile:

Daher Fawares wrote:

Yes, Thanks a lot. works perfectly now…

Daher

On Wed, 2005-07-13 at 20:24 +0200, Ralf Buschmann wrote:

>Daher,
>
>you wrote on Thursday, July 14, 2005, 04:37:58:
>
>D> I am following the msdn step by step with trying to backup my
>D> exchange server, but I get an access denied error while trying to
>D> call ‘HrESEBackupPrepare’ … I am running as an Administrator on the
>D> and the server is on the local mahcine… w2k3 … exchange 2003…
>
>[snip]
>
>D> Is there any special preveleges that I should set to the user account?
>
>Actually, I would try granting the backup privilege (SE_BACKUP_NAME),
>yes … :slight_smile:

Hello Daher,

  1. Just like the backup privs, you’ll also have to set restore privs
    when restoring Exchange.

  2. Make sure that when you’re done with your backup/restore, you return
    those privs back - I say this partially to indicate good programming
    practices but mostly to prevent malicious attacks.

  3. Your app will have to work on a user who’s in the backup operators
    group. If possible make a backup op a/c (not admin) to test your stuff.
    You’ll be glad u did that (and not test on the admin account).

Uv