exchangefreaks.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

There is a naming violation - Creating a contact object

 
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange 2000 Development
Author Message
jgfreitas



Joined: 06 Aug 2007
Posts: 1

PostPosted: Fri Aug 03, 2007 10:16 am    Post subject: There is a naming violation - Creating a contact object Reply with quote

Hi Experts...

Anyone could help me?
I´m getting this error when I try to create a new contact object on
AD / Exchange using special characters on Common Name:

{"There is a naming violation." }
{System.Runtime.InteropServices.COMException}
_COMPlusExceptionCode: -532459699
_HResult: -2147016649
_message: There is a naming violation.
Source: System.DirectoryServices

The code I´m using is below:

public void CriarContact

(string accountBusca, string fullName, string firstName,
string lastName,
string initials, string displayName, string ag, string
mail, string company, string telephoneNumber,
string country, string state, string city, string manager,
string notes, string alias, string ou
)
{
try
{

DirectoryEntry de = null;
if(!ou.Equals(String.Empty))
{
string path = Entry.Path.Substring(0,
Entry.Path.ToUpper().IndexOf("DC=")) + ou;
DirectoryEntry deOU = new
DirectoryEntry(path);

de = deOU.Children.Add("CN=" +
accountBusca, "Contact");
}
else
{
de = Entry.Children.Add("CN=" +
accountBusca, "Contact");
}

de.Properties["displayName"].Add(displayName);
de.Properties["givenName"].Add(firstName);
de.Properties["sn"].Add(lastName);
de.Properties["initials"].Add(initials);

if (!mail.Trim().Equals(string.Empty))
de.Properties["mail"].Add(mail);

if (!alias.Trim().Equals(string.Empty))

de.Properties["mailNickName"].Add(alias);

DirectoryEntry deManager =
ObterUsuarioPorAccount(manager);

de.Properties["manager"].Add(deManager.Properties["distinguishedName"].Value.ToString());

de.Properties["info"].Add(notes);

IMailRecipient oMB =
(IMailRecipient)de.NativeObject;
oMB.AutoGenerateEmailAddresses = false;
oMB.Alias = accountBusca;
oMB.SMTPEmail = mail;
de.Properties["TargetAddress"].Add("SMTP: " +
mail);
de.CommitChanges();
de.Close();
}


Is this possible? (to use special characters on the common name of the
object)
I found this Microsoft article about this subject, but the server
where I´m running the app is Win 2003... so I can't apply the
hotfix...

http://support.microsoft.com/kb/834541/en-us

I would appreciate any help...
Tnks
Juliana

Archived from group: microsoft>public>exchange2000>development
Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Accessing the Private field of a contact/IPerson object I am trying to apply a filter on Contacts of either a private store or Public Folder where I only return items that are not marked private. The code (server-side application) is running under an account that has access to other person's mailbox. The filte

Creating Forms for Exchange How do we create forms for use in Exchange. I've got a client with Exchange and we want either to add on or replace the resource scheduling dialog (or whatever it is) for reserving conference rooms. We want to add information about the room, show a pictur

Creating User Accounts & Mailboxes Hi, I'm struggling a little here. Have a home grown web based application that we use to create user accounts in AD. I'm trying to modify this to include creating the Exchange 2000 mailbox also (I'm not a programmer). I understand I need to use CDOEXM to

access personal contact get 409 Error Hi ALL, I have created a project to access personal contact by webdav. However, one of my customer return 409 error, I have googled it, but I do not know the exactly reason. Here is my query: S

Object cannot be created at this URL because an object named Hi All, I want to develop one application in vb.net for exchange 2000. I tried to add one contact with the code snippet below. The same logic is there for appointment on Microsoft's site. (I added Microsoft CDO exchange library for 2000 & activex data obj
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange 2000 Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group