A
Ajey
Hi,
I am using MprAdminUserGetInfo API to get the RAS information for the
users in my domain. This API was failing inconsistently in my code. So, I
wrote a simple script which calls this API. My domain has more than 100000
users. In the script I am just calling this API as follow:
for (unsigned long ulIndex=1; ulIndex<=1000; ulIndex++)
{
wchar_t lpwsPDCName[UNCLEN + 10];
::wcscpy (lpwsPDCName, L"\\\\MYDOMAINDC");
CString csUserName;
csUserName.Format (L"myUser1k_%05d", ulIndex);
std::auto_ptr<RAS_USER_1> apRasUser1(new RAS_USER_1);
RAS_USER_1* pRasUser1 = apRasUser1.get();
::ZeroMemory(pRasUser1, sizeof(RAS_USER_1));
::wprintf (L"\n====================================================\n");
::wprintf (L"lpwsPDCName = %s\n", lpwsPDCName);
::wprintf (L"csUserName = %s\n", csUserName.operator LPCTSTR());
for (unsigned short usRetryCount=1; usRetryCount<4; usRetryCount++)
{
// _fpMprAdminUserGetInfo function pointer
DWORD dwError = _fpMprAdminUserGetInfo(lpwsPDCName, csUserName, 1,
reinterpret_cast<BYTE*>(pRasUser1));
if (dwError != NO_ERROR)
{
::wprintf (L"MprAdminUserGetInfo [%d] returned with error = 0x%08X\n",
usRetryCount, dwError);
::Sleep (usRetryCount*500);
::wprintf (L"Resuming after sleep [%d]...\n", usRetryCount*500);
//MessageBox (NULL, L"error in MprAdminUserGetInfo", NULL, MB_OK);
}
else
{
::wprintf (L"MprAdminUserGetInfo succeeded\n");
break;
}
}// retry
}// for each user
I get the errors:
0x80070035 (The network path was not found.) and error 0x8007203A (The
server is not operational.)
This error come when I run the script on OU with more than 500 users.
Also, I enabled the RRAS loggin and found following error in the IASSDO.LOG
file:
Error when API fails:
[156] 12:18:05:249: Machine SDO is attempting to attach to computer:
'MYDOMAINDC'...
[156] 12:18:05:249: Machine SDO is initializing the IAS support services...
[156] 12:18:05:265: Machine SDO is creating the SDO schema...
[156] 12:18:05:265: Machine SDO has successfully attached to computer:
'MYDOMAINDC'...
[156] 12:18:05:265: Machine SDO is attempting to retrieve the RAS User SDO
for user: myUser1k_00001...
[156] 12:18:05:280: Machine SDO - GetUserSDO() - Using server MYDOMAINDC
with Net APIs...
[156] 12:18:05:296: Error in Machine SDO - GetUserSDO() - Could not obtain
user object from data store...
Error when API succeeds:
[1476] 12:18:06:655: Machine SDO is attempting to attach to computer:
'MYDOMAINDC'...
[1476] 12:18:06:655: Machine SDO is initializing the IAS support services...
[1476] 12:18:06:655: Machine SDO is creating the SDO schema...
[1476] 12:18:06:655: Machine SDO has successfully attached to computer:
'MYDOMAINDC'...
[1476] 12:18:06:937: Machine SDO is attempting to retrieve the RAS User SDO
for user:
LDAP://MYDOMAINDC/DC=com/DC=punetest/DC=windom/OU=bvcWindows/OU=1000Users/CN=myUser1k_00023...
[1476] 12:18:07:062: Machine SDO - GetUserSDO() - Current DC (Server)
MYDOMAINDC is in a mixed mode domain...
[1476] 12:18:07:062: Server SDO - GetUserSDO() - User's SAM account name is:
myUser1k_00023...
[1476] 12:18:07:062: Machine SDO - GetUserSDO() - Using server MYDOMAINDC
with downlevel APIs...
Are there any know issues with the MprAdminUserGetInfo API or can I change
some settings to get this work.
TIA,
Ajey
I am using MprAdminUserGetInfo API to get the RAS information for the
users in my domain. This API was failing inconsistently in my code. So, I
wrote a simple script which calls this API. My domain has more than 100000
users. In the script I am just calling this API as follow:
for (unsigned long ulIndex=1; ulIndex<=1000; ulIndex++)
{
wchar_t lpwsPDCName[UNCLEN + 10];
::wcscpy (lpwsPDCName, L"\\\\MYDOMAINDC");
CString csUserName;
csUserName.Format (L"myUser1k_%05d", ulIndex);
std::auto_ptr<RAS_USER_1> apRasUser1(new RAS_USER_1);
RAS_USER_1* pRasUser1 = apRasUser1.get();
::ZeroMemory(pRasUser1, sizeof(RAS_USER_1));
::wprintf (L"\n====================================================\n");
::wprintf (L"lpwsPDCName = %s\n", lpwsPDCName);
::wprintf (L"csUserName = %s\n", csUserName.operator LPCTSTR());
for (unsigned short usRetryCount=1; usRetryCount<4; usRetryCount++)
{
// _fpMprAdminUserGetInfo function pointer
DWORD dwError = _fpMprAdminUserGetInfo(lpwsPDCName, csUserName, 1,
reinterpret_cast<BYTE*>(pRasUser1));
if (dwError != NO_ERROR)
{
::wprintf (L"MprAdminUserGetInfo [%d] returned with error = 0x%08X\n",
usRetryCount, dwError);
::Sleep (usRetryCount*500);
::wprintf (L"Resuming after sleep [%d]...\n", usRetryCount*500);
//MessageBox (NULL, L"error in MprAdminUserGetInfo", NULL, MB_OK);
}
else
{
::wprintf (L"MprAdminUserGetInfo succeeded\n");
break;
}
}// retry
}// for each user
I get the errors:
0x80070035 (The network path was not found.) and error 0x8007203A (The
server is not operational.)
This error come when I run the script on OU with more than 500 users.
Also, I enabled the RRAS loggin and found following error in the IASSDO.LOG
file:
Error when API fails:
[156] 12:18:05:249: Machine SDO is attempting to attach to computer:
'MYDOMAINDC'...
[156] 12:18:05:249: Machine SDO is initializing the IAS support services...
[156] 12:18:05:265: Machine SDO is creating the SDO schema...
[156] 12:18:05:265: Machine SDO has successfully attached to computer:
'MYDOMAINDC'...
[156] 12:18:05:265: Machine SDO is attempting to retrieve the RAS User SDO
for user: myUser1k_00001...
[156] 12:18:05:280: Machine SDO - GetUserSDO() - Using server MYDOMAINDC
with Net APIs...
[156] 12:18:05:296: Error in Machine SDO - GetUserSDO() - Could not obtain
user object from data store...
Error when API succeeds:
[1476] 12:18:06:655: Machine SDO is attempting to attach to computer:
'MYDOMAINDC'...
[1476] 12:18:06:655: Machine SDO is initializing the IAS support services...
[1476] 12:18:06:655: Machine SDO is creating the SDO schema...
[1476] 12:18:06:655: Machine SDO has successfully attached to computer:
'MYDOMAINDC'...
[1476] 12:18:06:937: Machine SDO is attempting to retrieve the RAS User SDO
for user:
LDAP://MYDOMAINDC/DC=com/DC=punetest/DC=windom/OU=bvcWindows/OU=1000Users/CN=myUser1k_00023...
[1476] 12:18:07:062: Machine SDO - GetUserSDO() - Current DC (Server)
MYDOMAINDC is in a mixed mode domain...
[1476] 12:18:07:062: Server SDO - GetUserSDO() - User's SAM account name is:
myUser1k_00023...
[1476] 12:18:07:062: Machine SDO - GetUserSDO() - Using server MYDOMAINDC
with downlevel APIs...
Are there any know issues with the MprAdminUserGetInfo API or can I change
some settings to get this work.
TIA,
Ajey