"A constraint violation occurred" error when trying to set Exchange 2000 "assistant" field
Top  Previous  Next


"A constraint violation occurred" means "incorrectly formatted parameter". In this case you are probably trying to write a name to the "assistant" field while Exchange 2000 expects a Distinguished Name.

Example
Set assistant for three accounts to DN for account with full name "John Smith"

[Settings_Begin]
BatchSettings.Delimiter=TAB
SET AccountName=%col4%    // %AccountName% instead of %col4% below = easier to change column
BatchSettings.MarkerCol=7

SET
 ADDomainPath=dc=com/dc=acme/dc=d31
SET ADOU=MailOU
SET ADOUPath=%ADDomainPath%/ou=%ADOU%
[Settings_End]

[Machines_Begin]
\\MAIN04
[Machines_End]

[Batch_Begin]
SET AssistantDN=ADValue (FullName,John Smith,distinguishedName)   
MessageBox "%AssistantDN%"   
Data.Loop
 Exchange.2k.Mailbox.SetProperty %ADOUPath%/cn=%AccountName%,$assistant,%AssistantDN%   
Data.Endloop   
[Batch_End]

[Data_Begin]
         accname1
         accname2
         accname3
[Data_End]