![]() |
#1 |
Участник
|
axinthefield: Comparing AX and Active Directory User Accounts
Источник: http://blogs.msdn.com/b/axinthefield...-accounts.aspx
============== I was recently working with an AX 2009 customer who wanted to compare the user accounts configured in AX with the user accounts in Active Directory. The basic goals were:
In the one real world scenario (AX 2009) that we looked at, AX had 112 orphaned accounts and there were another 75 accounts that were disabled in AD but not in AX. This procedure should work for both AX 4.0 and 2009. The userinfo table still exists in AX 2012, so the comparison should work with this version too, but there might be some scenarios such as flexible authentication that throw the results off. That's something I haven't really looked into yet. Источник: http://blogs.msdn.com/b/axinthefield...-accounts.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
![]() |
#2 |
Участник
|
|
|
![]() |
#3 |
Участник
|
Тут по некотором размышлении родился джобик, который делает то же самое "без лишнего шума и пыли":
X++: #define.UserAccountControl ('userFlags') #define.UF_ACCOUNTDISABLE (0x0002) Counter numTotal; Counter numNotFound; Counter numDisabled; UserInfo userInfo; int userAccControl; COM dirObject; str dirPath; ; while select userInfo where userInfo.networkAlias && userInfo.networkDomain { numTotal++; dirPath = strfmt(@"WinNT://%1/%2,User", userInfo.networkDomain, userInfo.networkAlias); dirObject = COM::getObjectEx(dirPath); if (dirObject) { if (userInfo.enable) { userAccControl = dirObject.get(#UserAccountControl); if (bitTest(userAccControl, #UF_ACCOUNTDISABLE)) { numDisabled++; info(strfmt("%2\%1 disabled in AD, but not in AX", userInfo.networkAlias, userInfo.networkDomain)); } } dirObject.finalize(); dirObject = null; } else { numNotFound++; warning(strfmt(@"%2\%1 - not found", userInfo.networkAlias, userInfo.networkDomain)); } } info(strfmt(@"Total: %1, not found: %2, disabled in AD, but not in AX: %3", numTotal, numNotFound, numDisabled)); |
|
![]() |
#4 |
Axapta
|
Хоть в исходной задаче этого и не было, но для красоты можно еще проверять accountExpires, а то аккаунт может быть незаблокированным, но с истекшим сроком годности.
|
|
Теги |
active directory, ax2009, ax4.0, законченный пример, пользователи |
|
|