BDC Dialing Permission

I was wondering if there is a way around my problem

I have a program which add users to the NT User Manager domain from a text file. One of the thing I do in the program is to give them the capability to dial the RAS Server and connect. This program works on a PDC. But when I run this program from a Backup Domain Controller, I get a error "This function can only be run from a PDC". I am using the following code

      if (UserAdded)
            ras_user.bfPrivilege = RASPRIV_DialinPrivilege | RASPRIV_NoCallback;
            dwResult = RasAdminUserSetInfo(lpwsUserServer,lpszName, &ras_user);
            if (dwResult == 0)
             printf("User configured for Remote Access. \n");
             printf("Unable to configure User for Remote Access. Result Code was %i\n", dwResult);


The lpwsUserServer is set to Null.

I get a error code of 2226.

Is there a way I can do this from a BDC.

Thanks a lot


Who is Participating?
jkrConnect With a Mentor Commented:
You can retrieve the PDC name by calling 'NetGetDCName()' - the domain name is a bit more tricky, but 'NetWkstaGetInfo()' called with level 101 provides the domain name in the 'wki101_langroup' member of the WKSTA_INFO_101 structure...
>>The lpwsUserServer is set to Null

Have you tried specifying the PDC name as this parameter?
rianAuthor Commented:
I did and it worked. Thanks a lot. Is there an API which gives me back the Domain Name of where the computer belongs too.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.