如何扩展ADSI的属性

kyc 2002-09-18 03:06:45
我现在要扩展类user 的一个属性; 假设为:extendionID,请给各位高手任何用程序实现。谢谢!
...全文
84 2 打赏 收藏 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
徐春华 2002-09-19
  • 打赏
  • 举报
回复
可以参考ADSI2.5SDK中的schema 扩展部分,一般来说对ADSI中的Schema的扩展是较为困难的,只有VC的接口。
另一办法是ADSI对象中有一些保留的扩展,如extensionName等,是可由用户自由支配的。
foobarren 2002-09-18
  • 打赏
  • 举报
回复
小柯,试试这个

Sub AddProgerty
DefineProperty "SchemaPath","user","extendionID","string", False, , True
end Sub

Function DefineProperty( _
ByVal AppSchemaFld As String, _
ByVal Namespace As String, _
ByVal PropertyName As String, _
Optional DataType As String = "string", _
Optional IsMultiValued As Boolean = False, _
Optional Default As String = "", _
Optional IsIndexed As Boolean = False)

' This function creates a property definition
' in an application schema folder. The default
' is to create a single-valued, string property
' that has no default value and is not indexed.

' If you are using VBScript, use this With:
' With CreateObject("ADODB.Record")
With New ADODB.Record
' Create the new property record
.Open AppSchemaFld & Replace(Namespace, ":", "-") & PropertyName _
, _
, adModeReadWrite _
, adCreateNonCollection + adCreateOverwrite
' Define the property
.Fields _
("DAV:contentclass") _
= "urn:content-classes:propertydef"
.Fields _
("urn:schemas-microsoft-com:xml-data#name") _
= Namespace & PropertyName
.Fields _
("urn:schemas-microsoft-com:datatypes#type") _
= DataType
.Fields _
("urn:schemas-microsoft-com:exch-data:ismultivalued") _
= IsMultiValued
.Fields _
("urn:schemas-microsoft-com:exch-data:defaultvalue") _
= Default
.Fields _
("urn:schemas-microsoft-com:exch-data:isindexed") _
= IsIndexed
' Save the changes
.Fields.Update
.Close
End With
End Function

536

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧