Exchange 5.5 help

Exchange 5.5 help

Post by Greg Marti » Thu, 18 Sep 2003 03:06:50


First let me apologize for not figuring this out myself. I've done alot of
searching but haven't found what I'm looking for.

I need to set an exch 5.5 attribute for a bunch of users. (It's
hide-from-address-book, but that doesn't matter). All of my adsi/ado
experience is with anonymous reading/querying LDAP and I haven't done any
modifys.

I'm looking for an exchange 5.5 example that does an autheticated bind to a
user object, modifies an attribute and committs the change. Can someoen
offer up some code?

Thanks
\\Greg
XXXX@XXXXX.COM
 
 
 

Exchange 5.5 help

Post by Greg Marti » Thu, 18 Sep 2003 04:02:54

I hate answering my own questions...
This script seems to work. Bad news is there is no authentication in the
script. Why is this allowed?

strAttribute = "Hide-From-Address-Book" ' "facsimileTelephoneNumber" '
"Telephone-Fax"
strValue = TRUE
Set oUsr =
GetObject(LDAP://myserver/cn=myuser,cn=Recipients,ou=mySite,o=MyOrg)
oUsr.Put strAttribute, strvalue
oUsr.SetInfo
Set oUsr = nothing

\\Greg
XXXX@XXXXX.COM


of
a

 
 
 

Exchange 5.5 help

Post by Greg Marti » Thu, 18 Sep 2003 04:12:03

Speculating...

Is this working because my credentials are being passed behind the scenes to
the DC?

\\Greg







any
to
 
 
 

Exchange 5.5 help

Post by maxv » Thu, 18 Sep 2003 04:27:01

Modifying properties on exchange 5.5 objects is straight forward once you have the DN to bind to the object. That is the most difficutl thing to find.

Once you have the LDAP ADsPath to the object, you can use IADsOpenDsObject::OpenDsObject to bind to the object in the directory using appropriate
crendentials.

For example:

dim oRecip
dim oPrv
set oPrv = GetObject("LDAP:")
set oRecip = oPrv.OpenDsObject("LDAP://EXCHANGE_SERVER/cn=JonDo,cn=Recipients,ou=MyDomain,o=Microsoft", "DOMAIN\USERID",
"PASSWORD", 1)

At this point you can modify any property available to you on the object. You can look at the Exchange 5.5 admin tool in raw mode to view availble properties.
To set a property you would use the IADs::Put for single valued properties or the IADs::PutEx for multivalued properties.

To push the changes to the Exchange 5.5 server, you would call the IADs::SetInfo method. This method flushes the ADSI property cache and saves the
changes to the Exchange 5.5 server.

Sincerely,
Max Vaughn [MS]
Microsoft Developer Support


Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.
 
 
 

Exchange 5.5 help

Post by Greg Marti » Thu, 18 Sep 2003 05:27:21

Thanks Max,

\\Greg




have the DN to bind to the object. That is the most difficutl thing to
find.
IADsOpenDsObject::OpenDsObject to bind to the object in the directory using
appropriate
oPrv.OpenDsObject("LDAP://EXCHANGE_SERVER/cn=JonDo,cn=Recipients,ou=MyDomain
,o=Microsoft", "DOMAIN\USERID",
You can look at the Exchange 5.5 admin tool in raw mode to view availble
properties.
or the IADs::PutEx for multivalued properties.
IADs::SetInfo method. This method flushes the ADSI property cache and saves
the
confers no rights. You assume all risk for your use.
 
 
 

Exchange 5.5 help

Post by Barlin » Thu, 18 Sep 2003 19:10:29

Hi!

I'm using VB.Net to do the same thing, but when I try to
pass on the credentials of the administrator of the
exchange server I just get COMException (0x80072027).

What authenticationtype should I use? I've tried several
but can't seem to get it to work :/

//B
 
 
 

Exchange 5.5 help

Post by maxv » Fri, 19 Sep 2003 22:45:05

Can you make a separate post for this question?

Sincerely,
Max Vaughn [MS]
Microsoft Developer Support


Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.