AXForum  
Вернуться   AXForum > Microsoft Dynamics NAV > NAV: Программирование
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 16.07.2007, 19:00   #1  
neot is offline
neot
Участник
 
44 / 10 (1) +
Регистрация: 22.03.2007
Коллеги! А случайно никто не сталкивался с примочкой, которая бы могла из интерфейса навижена управлять адресной книгой active DIRECTORY. Ну скажем, менять номер телефона или отдел. заранее благодарю за ответы!
Старый 17.07.2007, 16:43   #2  
Forward is offline
Forward
Участник
 
101 / 10 (1) +
Регистрация: 21.05.2007
Если вы хотели спросить - управляет атрибутами в active directory, например такими как номера телефонов,
то тогда

Посмотреть например имя можно так:

Код:
Name	DataType	Subtype	Length
ADOConnection	Automation	'Microsoft ActiveX Data Objects 2.8 Library'.Connection	
ADORecSet	Automation	'Microsoft ActiveX Data Objects 2.8 Library'.Recordset	
ADOCommand	Automation	'Microsoft ActiveX Data Objects 2.8 Library'.Command	
SQLString	Text		1000



CREATE(ADOConnection);
CREATE(ADORecSet);
CREATE(ADOCommand);

ADOConnection.Open('Provider=ADsDSOObject;');

SQLString := '<LDAP://dc=Ваш,dc=Домен>;(&(objectclass=user)(objectcategory=Person)(sn=Фамилия Пользователя));' +
'ADsPath,objectSid,objectGUID,sAMAccountName,userPrincipalName,Name,initials,
sn,givenName,displayName,street,l,st,co,c,Title,'+
'Department,physicalDeliveryOfficeName,Manager,TelephoneNumber,mail,facsimile
TelephoneNumber,'+
'wWWHomePage,pager,mobile,homePhone,ipPhone';
ADORecSet := ADOConnection.Execute(SQLString);
ADORecSet.MoveFirst;

REPEAT
   MESSAGE(FORMAT(ADORecSet.Fields.Item('NAme').Value));
   ADORecSet.MoveNext;
UNTIL ADORecSet.EOF;
ADORecSet.Close;
ADOConnection.Close;
Остальные атрибуты вы можете видеть в SQLString.

Редактировать параметры не доводилось, но я думаю это удастся если посмотрите в сторону Active DS Type Library.
Старый 18.07.2007, 10:29   #3  
neot is offline
neot
Участник
 
44 / 10 (1) +
Регистрация: 22.03.2007
А можно поподробнее объяснить вот
ту строчку?

SQLString := '<LDAP://dc=Ваш,dc=Домен>;(&(objectclass=user)(objectcategory=Person)(sn=Фамилия Пользователя));' +
Старый 18.07.2007, 11:45   #4  
neot is offline
neot
Участник
 
44 / 10 (1) +
Регистрация: 22.03.2007
выдает ошибку
Either BOF or EOF is true, or the current record has been deleted.Requested operation requires a current record
Старый 18.07.2007, 12:11   #5  
Forward is offline
Forward
Участник
 
101 / 10 (1) +
Регистрация: 21.05.2007
Код:
Search filter examples:

To return all user objects with cn (Common Name) beginning with the string "Joe":

"(&(objectCategory=person)(objectClass=user)(cn=Joe*))"

 

To return all user objects. This filter is more efficient than the one using both objectCategory and objectClass, but is harder to remember:

"(sAMAccountType=805306368)"

 

To return all computer objects with no entry for description:

"(&(objectCategory=computer)(!description=*))"

 

To return all user and contact objects:

"(objectCategory=person)"

 

To return all group objects with any entry for description:

"(&(objectCategory=group)(description=*))"

 

To return all groups with cn starting with either "Test" or "Admin":

"(&(objectCategory=group)(|(cn=Test*)(cn=Admin*)))"

 

To return all objects with Common Name "Jim * Smith":

"(cn=Jim \2A Smith)"

 

To retrieve the object with GUID = "90395FB99AB51B4A9E9686C66CB18D99":

"(objectGUID=\90\39\5F\B9\9A\B5\1B\4A\9E\96\86\C6\6C\B1\8D\99)"

 

To return all users with "Password Never Expires" set:

"(&(objectCategory=person)(objectClass=user)" _

	& "(userAccountControl:1.2.840.113556.1.4.803:=65536))"

 

To return all users with disabled accounts:

"(&(objectCategory=person)(objectClass=user)" _

	& "(userAccountControl:1.2.840.113556.1.4.803:=2))"

 

To return all distribution groups:

"(&(objectCategory=group)" _

	& "(!groupType:1.2.840.113556.1.4.803:=2147483648))"

 

To return all users with "Allow access" checked on the "Dial-in" tab of the user properties dialog of Active Directory Users & Computers. This is all users allowed to dial-in. Note that "TRUE" is case sensitive:

"(&(objectCategory=person)(objectClass=user)" _

	& "(msNPAllowDialin=TRUE))"

 

To return all user objects created after a specified date (09/01/2002):

"(&(objectCategory=person)(objectClass=user)" _

	& "(whenCreated>=20020901000000.0Z))"

 

To return all users that must change their password the next time they logon:

"(&(objectCategory=person)(objectClass=user)" _

	& "(pwdLastSet=0))"

 

To return all users that changed their password since 2/5/2004. See the link below for a function to convert a date value to an Integer8 (64-bit) value. The date 2/5/2004 converts to the number 127,204,308,000,000,000:

"(&(objectCategory=person)(objectClass=user)" _

	& "(pwdLastSet>=127204308000000000))"

 

To return all users with the group "Domain Users" designated as their "primary" group:

"(&(objectCategory=person)(objectClass=user)" _

	& "(primaryGroupID=513))"

 

To return all users with any group other than "Domain Users" designated as their "primary" group:

"(&(objectCategory=person)(objectClass=user)" _

	& "(!primaryGroupID=513))"

 

To return all users not required to have a password:

"(&(objectCategory=person)(objectClass=user)" _

	& "(userAccountControl:1.2.840.113556.1.4.803:=32))"

 

To return all users that are direct members of a specified group. You must specify the Distinguished Name of the group. Wildcards are not allowed:

"(&(objectCategory=person)(objectClass=user)" _

	& "(memberOf=cn=TestGroup,ou=Sales,dc=MyDomain,dc=com))"

 

To return all computers that are not Domain Controllers.

"(&(objectCategory=Computer)" _

	& "(!userAccountControl:1.2.840.113556.1.4.803:=8192))"

 

To return all user accounts that do not expire. The value of the accountExpires attribute can be either 0 or 2^63-1:

"(&(objectCategory=person)(objectClass=user)" _

	& "(|(accountExpires=9223372036854775807)(accountExpires=0)))"
Старый 18.07.2007, 12:21   #6  
Forward is offline
Forward
Участник
 
101 / 10 (1) +
Регистрация: 21.05.2007
Странно что выдает ошибку.
У меня все работает, попробуйте проверить права доступа на чтение из AD.
Еще хинт: создайте vbs файл со следующим содержимым

Код:
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"

Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection

objCommand.CommandText = _
"<LDAP://dc=ВашДомен,dc=com>;(&(objectclass=user)(objectcategory=Person)(sn=Фамилия Пользователя));ADsPath,objectSid,objectGUID,sAMAccountName,userPrincipalName,Name,initials
,sn,givenName,displayName,street,l,st,co,c,Title,Department,physicalDeliveryOffi
c
eName,Manager,TelephoneNumber,mail,facsimileTelephoneNumber,wWWHomePage,pager,mo
b
ile,homePhone,ipPhone"
Set objRecordSet = objCommand.Execute

While Not objRecordSet.EOF
 Wscript.Echo objRecordSet.Fields("Name")
 objRecordSet.MoveNext
Wend

objConnection.Close
и с ним поэкспериментируйте.
Старый 24.07.2007, 13:20   #7  
neot is offline
neot
Участник
 
44 / 10 (1) +
Регистрация: 22.03.2007
Все. Получилось.Спасибо. Я убрал (sn=Фамилия Пользователя)
Старый 24.07.2007, 17:44   #8  
Forward is offline
Forward
Участник
 
101 / 10 (1) +
Регистрация: 21.05.2007
Всегда пожалуйста =).
Если будете разбираться с апдейтом AD, не забудьте рассказать, мне интересно, можно в личку.
 


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 13:17.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.