LoyolaTS
asked on
Unable to use ILM to set the MSExchHideFromAddressLists attribute in AD
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("MSExchHideFromAdd ressLists" ).BooleanV alue = True
When I run a sync, I get the following error message:
System.InvalidOperationExc eption: attribute msExchHideFromAddressLists is read-only
at Microsoft.MetadirectorySer vices.Impl .Attribute Impl.set_B ooleanValu e(Boolean value)
at Mms_ManagementAgent_Active DirectoryM A.MAExtens ionObject. MapAttribu tesForExpo rt(String FlowRuleName, MVEntry mventry, CSEntry csentry) in
What am I doing wrong?
csentry("MSExchHideFromAdd
When I run a sync, I get the following error message:
System.InvalidOperationExc
at Microsoft.MetadirectorySer
at Mms_ManagementAgent_Active
What am I doing wrong?
ASKER
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").IsPres ent Then
strloyRoles = mventry("loyRoles").Value. ToLower
Else
strloyRoles = ""
End If
If (mventry("loyIsAlumni").Is Present AndAlso mventry("loyIsEmployee").I sPresent AndAlso mventry("loyIsFaculty").Is Present AndAlso mventry("loyIsGradStu").Is Present AndAlso mventry("loyIsNonLoyolaStu ").IsPrese nt AndAlso mventry("loyIsStuWithdrawn ").IsPrese nt AndAlso mventry("loyIsUnGradStu"). IsPresent) Then
If (mventry("loyIsNonEmp").Is Present AndAlso (mventry("loyIsNonEmp").Va lue.ToUppe r = "NEL" Or mventry("loyIsNonEmp").Val ue.ToUpper = "NER" Or mventry("loyIsNonEmp").Val ue.ToUpper = "NED" Or mventry("loyIsNonEmp").Val ue.ToUpper = "NEB" Or mventry("loyIsNonEmp").Val ue.ToUpper = "NEJ" Or mventry("loyIsNonEmp").Val ue.ToUpper = "NET" Or mventry("loyIsNonEmp").Val ue.ToUpper = "NES" Or mventry("loyIsNonEmp").Val ue.ToUpper = "NEG" Or mventry("loyIsNonEmp").Val ue.ToUpper = "NEC")) Then
'Do nothing because user is NEMP (non-employee)
'Enable/Disable account is done manually
ElseIf strloyRoles.Contains("serv iceacct") Then
'Do nothing because the account is a service account
Else
'If all flags inactive and user is not emeritus, disable
If (mventry("loyIsAlumni").Va lue.ToLowe r = "n" AndAlso mventry("loyIsEmployee").V alue.ToLow er = "n" AndAlso mventry("loyIsFaculty").Va lue.ToLowe r = "n" AndAlso mventry("loyIsGradStu").Va lue.ToLowe r = "n" AndAlso mventry("loyIsNonLoyolaStu ").Value.T oLower = "n" AndAlso mventry("loyIsStuWithdrawn ").Value.T oLower = "n" AndAlso mventry("loyIsUnGradStu"). Value.ToLo wer = "n") Then
If (mventry("loyJobClass").Is Present AndAlso mventry("loyJobClass").Val ue = "13") Then
csentry("userAccountContro l").Intege rValue = NORMAL_ACCOUNT
Else
csentry("userAccountContro l").Intege rValue = ACCOUNTDISABLE
csentry("MSExchHideFromAdd ressLists" ).BooleanV alue = True
End If
'If any flag active, enable
If (mventry("loyIsAlumni").Va lue.ToLowe r = "y" Or mventry("loyIsEmployee").V alue.ToLow er = "y" Or mventry("loyIsFaculty").Va lue.ToLowe r = "y" Or mventry("loyIsGradStu").Va lue.ToLowe r = "y" Or mventry("loyIsNonLoyolaStu ").Value.T oLower = "y" Or mventry("loyIsStuWithdrawn ").Value.T oLower = "y" Or mventry("loyIsUnGradStu"). Value.ToLo wer = "y") Then
csentry("userAccountContro l").Intege rValue = NORMAL_ACCOUNT
csentry("MSExchHideFromAdd ressLists" ).BooleanV alue = False
End If
End If
End If
End If
Case "StatusFlagDisable"
Dim strloyRoles As String
If mventry("loyRoles").IsPres
strloyRoles = mventry("loyRoles").Value.
Else
strloyRoles = ""
End If
If (mventry("loyIsAlumni").Is
If (mventry("loyIsNonEmp").Is
'Do nothing because user is NEMP (non-employee)
'Enable/Disable account is done manually
ElseIf strloyRoles.Contains("serv
'Do nothing because the account is a service account
Else
'If all flags inactive and user is not emeritus, disable
If (mventry("loyIsAlumni").Va
If (mventry("loyJobClass").Is
csentry("userAccountContro
Else
csentry("userAccountContro
csentry("MSExchHideFromAdd
End If
'If any flag active, enable
If (mventry("loyIsAlumni").Va
csentry("userAccountContro
csentry("MSExchHideFromAdd
End If
End If
End If
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
can you post the complete section where that piece is used?