Unable to use ILM to set the MSExchHideFromAddressLists attribute in AD

LoyolaTS
LoyolaTS used Ask the Experts™
on
When I disable a user in ILM 2007, I would like to hide them in the Exchange 2007 address book.  I currently have this piece of code in my AD MA:

csentry("MSExchHideFromAddressLists").BooleanValue = True

When I run a sync, I get the following error message:

System.InvalidOperationException: attribute msExchHideFromAddressLists is read-only
   at Microsoft.MetadirectoryServices.Impl.AttributeImpl.set_BooleanValue(Boolean value)
   at Mms_ManagementAgent_ActiveDirectoryMA.MAExtensionObject.MapAttributesForExport(String FlowRuleName, MVEntry mventry, CSEntry csentry) in

What am I doing wrong?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
you can only use that (csentry("MSExchHideFromAddressLists").BooleanValue = True) during outbound attribute flow (from MV to CS)
 
can you post the complete section where that piece is used?

Author

Commented:
This code is part of my ActiveDirectoryMA.dll which is a rules extension of my AD management agent.  What I'm trying to do is remove employees from the address book at the same time they are being disabled.

Case "StatusFlagDisable"
                Dim strloyRoles As String

                If mventry("loyRoles").IsPresent Then
                    strloyRoles = mventry("loyRoles").Value.ToLower
                Else
                    strloyRoles = ""
                End If

                If (mventry("loyIsAlumni").IsPresent AndAlso mventry("loyIsEmployee").IsPresent AndAlso mventry("loyIsFaculty").IsPresent AndAlso mventry("loyIsGradStu").IsPresent AndAlso mventry("loyIsNonLoyolaStu").IsPresent AndAlso mventry("loyIsStuWithdrawn").IsPresent AndAlso mventry("loyIsUnGradStu").IsPresent) Then
                    If (mventry("loyIsNonEmp").IsPresent AndAlso (mventry("loyIsNonEmp").Value.ToUpper = "NEL" Or mventry("loyIsNonEmp").Value.ToUpper = "NER" Or mventry("loyIsNonEmp").Value.ToUpper = "NED" Or mventry("loyIsNonEmp").Value.ToUpper = "NEB" Or mventry("loyIsNonEmp").Value.ToUpper = "NEJ" Or mventry("loyIsNonEmp").Value.ToUpper = "NET" Or mventry("loyIsNonEmp").Value.ToUpper = "NES" Or mventry("loyIsNonEmp").Value.ToUpper = "NEG" Or mventry("loyIsNonEmp").Value.ToUpper = "NEC")) Then
                        'Do nothing because user is NEMP (non-employee)
                        'Enable/Disable account is done manually
                    ElseIf strloyRoles.Contains("serviceacct") Then
                        'Do nothing because the account is a service account
                    Else
                        'If all flags inactive and user is not emeritus, disable
                        If (mventry("loyIsAlumni").Value.ToLower = "n" AndAlso mventry("loyIsEmployee").Value.ToLower = "n" AndAlso mventry("loyIsFaculty").Value.ToLower = "n" AndAlso mventry("loyIsGradStu").Value.ToLower = "n" AndAlso mventry("loyIsNonLoyolaStu").Value.ToLower = "n" AndAlso mventry("loyIsStuWithdrawn").Value.ToLower = "n" AndAlso mventry("loyIsUnGradStu").Value.ToLower = "n") Then
                            If (mventry("loyJobClass").IsPresent AndAlso mventry("loyJobClass").Value = "13") Then
                                csentry("userAccountControl").IntegerValue = NORMAL_ACCOUNT
                            Else
                                csentry("userAccountControl").IntegerValue = ACCOUNTDISABLE
                                csentry("MSExchHideFromAddressLists").BooleanValue = True
                            End If
                            'If any flag active, enable
                            If (mventry("loyIsAlumni").Value.ToLower = "y" Or mventry("loyIsEmployee").Value.ToLower = "y" Or mventry("loyIsFaculty").Value.ToLower = "y" Or mventry("loyIsGradStu").Value.ToLower = "y" Or mventry("loyIsNonLoyolaStu").Value.ToLower = "y" Or mventry("loyIsStuWithdrawn").Value.ToLower = "y" Or mventry("loyIsUnGradStu").Value.ToLower = "y") Then
                                csentry("userAccountControl").IntegerValue = NORMAL_ACCOUNT
                                csentry("MSExchHideFromAddressLists").BooleanValue = False
                            End If
                        End If
                    End If
                End If
Commented:
I was trying to change multiple attributes during an advanced export attribute flow.  I built a separate attribute flow and was able to change the MSExchHideFromAddressLists attribute.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial