Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

BDC Dialing Permission

Posted on 1999-07-15
3
Medium Priority
?
333 Views
Last Modified: 2008-03-10
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");
            }
            else
            {
             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

RC

0
Comment
Question by:rian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 1200277
>>The lpwsUserServer is set to Null

Have you tried specifying the PDC name as this parameter?
0
 

Author Comment

by:rian
ID: 1200278
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.
0
 
LVL 86

Accepted Solution

by:
jkr earned 400 total points
ID: 1200279
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...
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question