Windows Server - Getting ERROR_ACCESS_DENIED when i am using NetDfsAddStdRoot.

Asked By RAVI KUMAR on 21-Mar-12 12:45 AM
Hi ,
I  had developed a simple program in win 7 32 bit(client) , to create a DFS Share in winserver2003.The RootShare is present in the server, but i am getting an error ERROR_ACCESS_DENIED , could any one can slove this issue, the code is :

using namespace std;
#include <windows.h>
#include <lm.h>
#include <lmdfs.h>
#include <stdio.h>
#pragma comment(lib, "NetApi32.lib")
void main()
  DWORD res=0;
LPWSTR ServerName=L"\\\\WINSRV2003_32";
LPWSTR RootShare=L"\\fshare";
res =NetDfsAddStdRoot(ServerName,RootShare,NULL,0);
  cout<<"Function succeeds"<<endl;
cout<<" Not Function succeeds"<<endl;
D Company replied to RAVI KUMAR on 21-Mar-12 09:48 AM
this article has helpful information, and detail description of the error