Failed to create Snapshot of SMB Share on Windows 2012, Application running under System/Local Admin

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have a sample C++ snapshot application which takes snapshot of SMB share. My requirement is to run this app under System/Local administrator account, inside the application I do Impersonation(LogonUser,ImpersonateLoggedOnUser) the domain user who is member
of administrators group/backup operators group on the server where the application is running and File Server.
But Application is failing at isVolumeSupported with access denied error if I have coinitializesecurity as follows
HRESULT hr = CoInitializeSecurity(NULL,
-1,<br/>
NULL, // asAuthSvc<br/>
NULL,<br/>
RPC_C_AUTHN_LEVEL_DEFAULT,<br/>
RPC_C_IMP_LEVEL_IMPERSONATE,<br/>
NULL,<br/>
EOAC_STATIC_CLOACKING,<br/>
NULL);

Simillarly the Application is failing at AddToSnapshotSet with error 0x8004230f, if I have coinitializesecurity as follows
HRESULT hr = CoInitializeSecurity(NULL,
-1,<br/>
NULL, // asAuthSvc<br/>
NULL,<br/>
RPC_C_AUTHN_LEVEL_DEFAULT,<br/>
RPC_C_IMP_LEVEL_IMPERSONATE,<br/>
NULL,<br/>
EOAC_NONE,<br/>
NULL);

And I see following event in event logs

Log Name: Application<br/>
Source: VSS<br/>
Date: 8/22/2012 10:59:35 PM<br/>
Event ID: 12293<br/>
Task Category: None<br/>
Level: Error<br/>
Keywords: Classic<br/>
User: N/A<br/>
Computer: Hyperv1_2012<br/>
Description:<br/>
Volume Shadow Copy Service error: Error calling a routine on a Shadow Copy Provider {89300202-3cec-4981-9171-19f59559e0f2}. Routine details BeginPrepareSnapshot({1eeabaef-5af6-40c0-8133-605ef3d13c3a},{ebba9287-2701-4d22-9163-73877bf5b1b6},\WINDOWS8.mydomain.LOCSMB)
[hr = 0x80010005, It is illegal to call out while inside message filter.]. <br/>
<br/>
Operation:<br/>
Add a Volume to a Shadow Copy Set<br/>
Context:<br/>
Execution Context: Coordinator
Can anyone help here, What Im missing?

View the full article
 
Back
Top