none
Import mail contact into Active Directory using CSVDE

    Question

  • Hello!

    I am trying to create a new external contact database in Active Directory and are experiencing problems with importing contacts with e-mails. I have been searching resources on this task on internet for two days but did not find a solution. On the offical Microsoft web page one can only find step-by-step guide for importing contacts with no e-mail address. I succeded to import contacts with no e-mail address, but I think It is a shame to give up and start creating e-mail addresses to contacts manualy.

     

    I am wondering is there anywere a list of necesary attributes for contacts with e-mail address? I found only list for exchange server, but as far as I understand that is not the same.

     

    I also export one contact to see the attributes, but the list was very long with a lot of attributes I do not understand.

     

    Following is the import cvs file that does not work. Ideas will be most appreciated.

     

    DN,objectClass,displayName,sn,description,targetAddress,extensionAttribute1,telephoneNumber,facsimileTelephoneNumber,co,company,streetAddress,mobile

    "CN=Abc Def,OU=Suppliers Electrical,OU=External Email Contacts,DC=hn,DC=local",contact,Abc Def,Def,Export Manager,SMTP:abc.def@podjetje.si,elec,01 111 22 33,01 111 22 31,Slovenia,podjetje d.o.o.,ulica št 13,040 256 654

     

     

    Regards,

     

    Vasja

    Monday, September 03, 2007 1:43 PM

Answers

  • Exporting with CSVDE (one contact with mail and organisation):

     

    DN,objectClass,cn,sn,title,givenName,distinguishedName,instanceType,whenCreated,whenChanged,uSNCreated,uSNChanged,department,company,name,objectGUID,objectCategory,dSCorePropagationData,mail
    "CN=Firstname Lastname,OU=Contacts,DC=demodom,DC=local",contact,Firstname Lastname,Lastname,Manager,Firstname,"CN=Firstname Lastname,OU=Contacts,DC=demodom,DC=local",4,20070904101842.0Z,20070904101920.0Z,28712,28714,Sales,Demodom,Firstname Lastname,X'101b66d465640c469253f51f31c744c4',"CN=Person,CN=Schema,CN=Configuration,DC=demodom,DC=local",16010101000000.0Z,firstname.lastname@demodom.local

     

    Exporting with LDIFDE (one contact with mail and organisation):

     

    dn: CN=Firstname Lastname,OU=Contacts,DC=demodom,DC=local
    changetype: add
    objectClass: top
    objectClass: person
    objectClass: organizationalPerson
    objectClass: contact
    cn: Firstname Lastname
    sn: Lastname
    title: Manager
    givenName: Firstname
    distinguishedName: CN=Firstname Lastname,OU=Contacts,DC=demodom,DC=local
    instanceType: 4
    whenCreated: 20070904101842.0Z
    whenChanged: 20070904101920.0Z
    uSNCreated: 28712
    uSNChanged: 28714
    department: Sales
    company: Demodom
    name: Firstname Lastname
    objectGUID:: EBtm1GVkDEaSU/UfMcdExA==
    objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=demodom,DC=local
    dSCorePropagationData: 16010101000000.0Z
    mail: firstname.lastname@demodom.local

     

    Import with LDIFDE (this will import a contact with email-address):

     

    - save as c:\in.ldf -

    dn: CN=Firstname2 Lastname2,OU=Contacts,DC=demodom,DC=local
    changetype: add
    objectClass: top
    objectClass: person
    objectClass: organizationalPerson
    objectClass: contact
    cn: Firstname2 Lastname2
    sn: Lastname2
    title: Manager
    givenName: Firstname2
    distinguishedName: CN=Firstname2 Lastname2,OU=Contacts,DC=demodom,DC=local
    instanceType: 4
    department: Sales
    company: Demodom
    name: Firstname2 Lastname2
    objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=demodom,DC=local
    mail: firstname2.lastname2@demodom.local

    --

     

    ldifde -i -f c:\in.ldf

     

    Import with CSVDE (this will import a contact with email-address):

     

    - Save as in.csv -

    DN,objectClass,cn,sn,title,givenName,distinguishedName,instanceType,department,company,name,objectCategory,mail
    "CN=Firstname3 Lastname3,OU=Contacts,DC=demodom,DC=local",contact,Firstname3 Lastname3,Lastname3,Manager,Firstname3,"CN=Firstname3 Lastname3,OU=Contacts,DC=demodom,DC=local",4,Sales,Demodom,Firstname3 Lastname3,"CN=Person,CN=Schema,CN=Configuration,DC=demodom,DC=local",firstname3.lastname3@demodom.local
    --

     

    csvde -i -f c:\in.csv

     

    Note that with csvde you'll need to have the columns on one line and the records separate on the following lines.

     

    Tuesday, September 04, 2007 11:24 AM
    Moderator
  • I'd recommend the following approach:

    Create a contact fulfilling all your requirements. Export that single contact with either LDIFDE or CSVDE. Note the format of the file and use it as a template.

    I managed to import contacts as I posted in my first post to your question, so it's a matter of trial and error. The easiest way of solving your problem is probably to create a contact to work from.
    Thursday, September 06, 2007 8:41 PM
    Moderator

All replies

  • According to http://support.microsoft.com/kb/233209/ you'll need some more attributes.

     

    A User is a Windows 2000 Active Directory security principal. A User may have an Exchange Server e-mail address but no Exchange Server mailbox or an Exchange Server e-mail address and an Exchange Server mailbox. A User who has an e-mail address is called mail-enabled and a user with a mailbox is called mailbox-enabled. In order for an object to be mailbox-enabled, the object has to be mail-enabled.

    A Contact is the Windows 2000 Active Directory representation of a user who is not a security principal (that is, the user cannot log on). A Contact may optionally have a target e-mail address and one or more Exchange Server e-mail addresses. The Exchange 2000 Server and Exchange Server 2003 concept of a Contact is the same as an Exchange Server 5.5 custom recipient.

    MORE INFORMATION

    A look in the Active Directory gives a much better view of the difference between a User and a Contact. Attributes for User and Contacts for all possible cases are defined below:
    Windows 2000 User with no mail-enabling or mailbox-enabling
    Windows 2000 User with mailbox-enabled
    Windows 2000 User with mail-enabled
    Windows 2000 Contact with no e-mail address
    Windows 2000 Contact with target e-mail address defined
    The most important aspect of the differences between the User and Contact are the fact that the User has several attributes, SAMAccountName, objectSID, userAccountControl, and userPrincipalName, which allow the User to log on. The Contact does not have these attributes. Notice also, the differences in the attributes defined for the two Contact types:

    Windows 2000 User - No Mail-enabling or Mailbox-enabling
    First Name: John
    Last Name: Doe
    User Logon Name: jdoe
      >> Dn: CN=John Doe,CN=Users,DC=pique,DC=extest,DC=microsoft,DC=com
    	1> accountExpires: 9223372036854775807; 
    	1> badPasswordTime: 0; 
    	1> badPwdCount: 0; 
    	1> codePage: 0; 
    	1> cn: John Doe; 
    	1> countryCode: 0; 
    	1> givenName: John; 
    	1> instanceType: 4; 
    	1> lastLogoff: 0; 
    	1> lastLogon: 0; 
    	1> logonCount: 0; 
    	1> distinguishedName: CN=John Doe,CN=Users,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	1> objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	4> objectClass: top; person; organizationalPerson; user; 
    	1> objectGUID: 0fcbed12-00d2-11d3-a9c5-00c04f68099e; 
    	1> objectSid: S-15-323E04BE-1898D11E-2B3BE507-457; 
    	1> primaryGroupID: 513; 
    	1> pwdLastSet: 125701524342968750; 
    	1> name: John Doe; 
    	1> sAMAccountName: jdoe; 
    	1> sAMAccountType: 805306368; 
    	1> sn: Doe; 
    	1> userAccountControl: 66048; 
    	1> userPrincipalName: jdoe@pique.extest.microsoft.com;
    	1> uSNChanged: 6459; 
    	1> uSNCreated: 6453; 
    	1> whenChanged: 5/2/1999 14:0:34 Pacific Standard Time Pacific Daylight Time; 
    	1> whenCreated: 5/2/1999 14:0:34 Pacific Standard Time Pacific Daylight Time; 
     	1> msExchMailboxSecurityDescriptor: <ldp: Binary blob>; 
    
    				

    Windows 2000 User - Mailbox-enabled
    First Name: John
    Last Name: Doe
    User Logon Name: jdoe
    Alias: jdoe
    >> Dn: CN=John Doe,CN=Users,DC=pique,DC=extest,DC=microsoft,DC=com
    	1> homeMDB: CN=Private MDB,CN=First Storage Group,CN=InformationStore,CN=KINDC,CN=Servers,
                          CN=First Administrative Group,CN=Administrative Groups,CN=OR1,CN=Microsoft Exchange,
                          CN=Services,CN=Configuration,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	1> accountExpires: 9223372036854775807; 
    	1> badPasswordTime: 0; 
    	1> badPwdCount: 0; 
    	1> codePage: 0; 
    	1> cn: John Doe; 
    	1> countryCode: 0; 
    	1> displayName: jdoe; 
    	1> mail: jdoe@pique.extest.microsoft.com; 
    	1> givenName: John; 
    	1> instanceType: 4; 
    	1> lastLogoff: 0; 
    	1> lastLogon: 0; 
    	1> legacyExchangeDN: /o=or1/ou=first administrative group/cn=Recipients/cn=jdoe; 
    	1> logonCount: 0; 
    	1> distinguishedName: CN=John Doe,CN=Users,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	1> objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	4> objectClass: top; person; organizationalPerson; user; 
    	1> objectGUID: a8ecb576-00d2-11d3-a9c5-00c04f68099e; 
    	1> objectSid: S-15-323E04BE-1898D11E-2B3BE507-458; 
    	1> primaryGroupID: 513; 
    	2> proxyAddresses: SMTP:jdoe@pique.extest.microsoft.com; X400:c=us;a= ;p=PIQUE;o=OR1;s=Doe;g=John;; 
    	1> pwdLastSet: 125701526912031250; 
    	1> name: John Doe; 
    	1> sAMAccountName: jdoe; 
    	1> sAMAccountType: 805306368; 
    	1> showInAddressBook: CN=Default Global Address List,CN=All Global Address Lists,
                                    CN=Address Lists Container,CN=OR1,CN=Microsoft Exchange,CN=Services,
                                    CN=Configuration,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	1> sn: Doe; 
    	1> textEncodedORAddress: c=us;a= ;p=PIQUE;o=OR1;s=Doe;g=John;; 
    	1> userAccountControl: 66048; 
    	1> userPrincipalName: jdoe@pique.extest.microsoft.com; 
    	1> uSNChanged: 6468; 
    	1> uSNCreated: 6462; 
    	1> whenChanged: 5/2/1999 14:4:51 Pacific Standard Time Pacific Daylight Time; 
    	1> whenCreated: 5/2/1999 14:4:51 Pacific Standard Time Pacific Daylight Time; 
    	1> msExchHideFromAddressLists: FALSE; 
    	1> homeMTA: CN=Microsoft MTA,CN=KINDC,CN=Servers,CN=First Administrative Group,
                          CN=Administrative Groups,CN=OR1,CN=Microsoft Exchange,CN=Services,
                          CN=Configuration,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	1> msExchHomeServerName: /o=OR1/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=KINDC; 
    	1> mailNickname: jdoe; 
    	1> mDBUseDefaults: TRUE; 
    	1> msExchMailboxSecurityDescriptor: <ldp: Binary blob>; 
    	1> deliveryMechanism: 0; 
    	1> msExchFBURL: http://pique.extest.microsoft.com/public/Public Folders/non_ipm_subtree
                              /SCHEDULE%252B FREE BUSY/EX%253A%252Fo=or1%252Fou=first administrative group
                              /USER-%252Fcn=Recipients%252Fcn=jdoe.EML;
    				

    Windows 2000 User - Mail-enabled Only
    First Name: John
    Last Name: Doe
    User Logon Name: jdoe
    Email address: jdoe@microsoft.com
    >> Dn: CN=John Doe,CN=Users,DC=pique,DC=extest,DC=microsoft,DC=com
    	1> accountExpires: 9223372036854775807; 
    	1> badPasswordTime: 0; 
    	1> badPwdCount: 0; 
    	1> codePage: 0; 
    	1> cn: John Doe; 
    	1> countryCode: 0; 
    	1> displayName: John Doe; 
    	1> mail: jdoe@microsoft.com; 
    	1> givenName: John; 
    	1> instanceType: 4; 
    	1> lastLogoff: 0; 
    	1> lastLogon: 0; 
    	1> legacyExchangeDN: /o=or1/ou=First Administrative Group/cn=Recipients/cn=jdoe; 
    	1> logonCount: 0; 
    	1> distinguishedName: CN=John Doe,CN=Users,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	1> objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	4> objectClass: top; person; organizationalPerson; user; 
    	1> objectGUID: f8aa1b8a-00d2-11d3-a9c5-00c04f68099e; 
    	1> objectSid: S-15-323E04BE-1898D11E-2B3BE507-459; 
    	1> primaryGroupID: 513; 
    	2> proxyAddresses: X400:c=us;a= ;p=PIQUE;o=OR1;s=Doe;g=John;; SMTP:jdoe@microsoft.com; 
    	1> pwdLastSet: 125701528249531250; 
    	1> name: John Doe; 
    	1> sAMAccountName: jdoe; 
    	1> sAMAccountType: 805306368; 
    	2> showInAddressBook: CN=All Users,CN=All Address Lists,CN=Address Lists Container,CN=OR1,
                                    CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=pique,DC=extest,DC=microsoft,DC=com;
                                    CN=Default Global Address List,CN=All Global Address Lists,
                                    CN=Address Lists Container,CN=OR1,CN=Microsoft Exchange,CN=Services,
                                    CN=Configuration,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	1> sn: Doe; 
    	1> textEncodedORAddress: c=us;a= ;p=PIQUE;o=OR1;s=Doe;g=John;; 
    	1> userAccountControl: 66048; 
    	1> userPrincipalName: jdoe@pique.extest.microsoft.com; 
    	1> uSNChanged: 6481; 
    	1> uSNCreated: 6473; 
    	1> whenChanged: 5/2/1999 14:7:48 Pacific Standard Time Pacific Daylight Time; 
    	1> whenCreated: 5/2/1999 14:7:4 Pacific Standard Time Pacific Daylight Time; 
    	1> msExchHideFromAddressLists: FALSE; 
    	1> internetEncoding: 1310720; 
    	1> mailNickname: jdoe; 
    	1> targetAddress: SMTP:jdoe@microsoft.com; 
    	1> msExchMailboxSecurityDescriptor: <ldp: Binary blob>; 
    	1> msExchALObjectVersion: 52;
    				
    Windows 2000 Contact with No Target Address
    First Name: John
    Last Name: Doe
    User Logon Name: jdoe
    Exchange Server e-mail address: jdoe@microsoft.com
    >>Dn: CN=John Doe,CN=Users,DC=pique,DC=extest,DC=microsoft,DC=com
    	1> cn: John Doe; 
    	1> givenName: John; 
    	1> instanceType: 4; 
    	1> distinguishedName: CN=John Doe,CN=Users,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	1> objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	4> objectClass: top; person; organizationalPerson; contact; 
    	1> objectGUID: a2d12e98-00d3-11d3-a9c5-00c04f68099e; 
    	1> name: John Doe; 
    	1> sn: Doe; 
    	1> uSNChanged: 6491; 
    	1> uSNCreated: 6491; 
    	1> whenChanged: 5/2/1999 14:11:56 Pacific Standard Time Pacific Daylight Time; 
    	1> whenCreated: 5/2/1999 14:11:56 Pacific Standard Time Pacific Daylight Time;
    				
    Windows 2000 Contact with Exchange Address Specified
    First Name: John
    Last Name: Doe
    User Logon Name: jdoe
    Exchange Server e-mail address: jdoe@microsoft.com
    >> Dn: CN=John Doe,CN=Users,DC=pique,DC=extest,DC=microsoft,DC=com
    	1> cn: John Doe; 
    	1> displayName: JohnDoe; 
    	1> mail: jdoe@microsoft.com; 
    	1> givenName: John; 
    	1> instanceType: 4; 
    	1> legacyExchangeDN: /o=or1/ou=First Administrative Group/cn=Recipients/cn=JohnDoe; 
    	1> distinguishedName: CN=John Doe,CN=Users,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	1> objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=pique,DC=extest,DC=microsoft,DC=com; 
    	4> objectClass: top; person; organizationalPerson; contact; 
    	1> objectGUID: 6388a3bd-00d3-11d3-a9c5-00c04f68099e; 
    	2> proxyAddresses: X400:c=us;a= ;p=PIQUE;o=OR1;s=Doe;g=John;; SMTP:jdoe@microsoft.com; 
    	1> name: John Doe; 
    	1> showInAddressBook: CN=Default Global Address List,CN=All Global Address Lists,
                                    CN=Address Lists Container,CN=OR1,CN=Microsoft Exchange,CN=Services,CN=Configuration,<BR/>
                                    DC=pique,DC=extest,DC=microsoft,DC=com; 
    	1> sn: Doe; 
    	1> textEncodedORAddress: c=us;a= ;p=PIQUE;o=OR1;s=Doe;g=John;; 
    	1> uSNChanged: 6486; 
    	1> uSNCreated: 6486; 
    	1> whenChanged: 5/2/1999 14:10:10 Pacific Standard Time Pacific Daylight Time; 
    	1> whenCreated: 5/2/1999 14:10:10 Pacific Standard Time Pacific Daylight Time; 
    	1> msExchHideFromAddressLists: FALSE; 
    	1> mailNickname: JohnDoe; 
    	1> targetAddress: SMTP:jdoe@microsoft.com;
    				
    Important In the Windows 2000 Contact with Exchange Address Specified contact type, the following two attributes have to be added to ensure that an attachment is sent correctly to the contact:
    1> InternetEncoding: 1310720 
    1> mAPIRecipient: False
    Monday, September 03, 2007 5:45 PM
    Moderator
  • Dear Joachim,

     

    thank you! I have tried and created another file, saidly It didn`t work. Most probably because I haven`t included all the attributes from your list. I will try to enclude as many of them as I can. Hopefully that will work. I don`t understand some of them and most probably never will. I exported one contact and compered the values of some attributes I don`t understand. I will insert those values from exported file into importing file. Hope It will work. Again, thank you!

     

    P.S.: Are all the attributes stated here mandatory or are some of them optional (as far as I read some are automaticaly created by AD if they are not stated in importing file). I am asking because If I can exclude some of them, the chanches of making an error decreases and It is easier to find out wich attribute might be the problematic one.   

     

    Regards,

    Vasja

    Tuesday, September 04, 2007 9:17 AM
  • Exporting with CSVDE (one contact with mail and organisation):

     

    DN,objectClass,cn,sn,title,givenName,distinguishedName,instanceType,whenCreated,whenChanged,uSNCreated,uSNChanged,department,company,name,objectGUID,objectCategory,dSCorePropagationData,mail
    "CN=Firstname Lastname,OU=Contacts,DC=demodom,DC=local",contact,Firstname Lastname,Lastname,Manager,Firstname,"CN=Firstname Lastname,OU=Contacts,DC=demodom,DC=local",4,20070904101842.0Z,20070904101920.0Z,28712,28714,Sales,Demodom,Firstname Lastname,X'101b66d465640c469253f51f31c744c4',"CN=Person,CN=Schema,CN=Configuration,DC=demodom,DC=local",16010101000000.0Z,firstname.lastname@demodom.local

     

    Exporting with LDIFDE (one contact with mail and organisation):

     

    dn: CN=Firstname Lastname,OU=Contacts,DC=demodom,DC=local
    changetype: add
    objectClass: top
    objectClass: person
    objectClass: organizationalPerson
    objectClass: contact
    cn: Firstname Lastname
    sn: Lastname
    title: Manager
    givenName: Firstname
    distinguishedName: CN=Firstname Lastname,OU=Contacts,DC=demodom,DC=local
    instanceType: 4
    whenCreated: 20070904101842.0Z
    whenChanged: 20070904101920.0Z
    uSNCreated: 28712
    uSNChanged: 28714
    department: Sales
    company: Demodom
    name: Firstname Lastname
    objectGUID:: EBtm1GVkDEaSU/UfMcdExA==
    objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=demodom,DC=local
    dSCorePropagationData: 16010101000000.0Z
    mail: firstname.lastname@demodom.local

     

    Import with LDIFDE (this will import a contact with email-address):

     

    - save as c:\in.ldf -

    dn: CN=Firstname2 Lastname2,OU=Contacts,DC=demodom,DC=local
    changetype: add
    objectClass: top
    objectClass: person
    objectClass: organizationalPerson
    objectClass: contact
    cn: Firstname2 Lastname2
    sn: Lastname2
    title: Manager
    givenName: Firstname2
    distinguishedName: CN=Firstname2 Lastname2,OU=Contacts,DC=demodom,DC=local
    instanceType: 4
    department: Sales
    company: Demodom
    name: Firstname2 Lastname2
    objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=demodom,DC=local
    mail: firstname2.lastname2@demodom.local

    --

     

    ldifde -i -f c:\in.ldf

     

    Import with CSVDE (this will import a contact with email-address):

     

    - Save as in.csv -

    DN,objectClass,cn,sn,title,givenName,distinguishedName,instanceType,department,company,name,objectCategory,mail
    "CN=Firstname3 Lastname3,OU=Contacts,DC=demodom,DC=local",contact,Firstname3 Lastname3,Lastname3,Manager,Firstname3,"CN=Firstname3 Lastname3,OU=Contacts,DC=demodom,DC=local",4,Sales,Demodom,Firstname3 Lastname3,"CN=Person,CN=Schema,CN=Configuration,DC=demodom,DC=local",firstname3.lastname3@demodom.local
    --

     

    csvde -i -f c:\in.csv

     

    Note that with csvde you'll need to have the columns on one line and the records separate on the following lines.

     

    Tuesday, September 04, 2007 11:24 AM
    Moderator
  • In your csv-file the attribute targetAddress is wrong. It's "mail" and the format of the address is email@address.com, not SMTP:email@address.com

     

     

    Tuesday, September 04, 2007 11:38 AM
    Moderator
  • Hi Joachim,

     

    I managed to import  external contacts to Active Directory almost successfully. But It worked, even with target address stated (tried both possibilities). But contacts were not shown in global address list, so I modified CVS file a little. Following is the modified list of attributes and values (previous one (the one that was imported but did not show in GAL) was missing the following attributes:objectCategory, objectGUID, showInAddressBook,  msExchHideFromAddressLists):

     

    This is the test file:

     

    DN,objectClass,instanceType,name,objectCategory,objectGUID,cn,sn,description,givenName,displayName,proxyAddresses,targetAddress,mAPIRecipient,extensionAttribute1,internetEncoding,showInAddressBook,msExchHideFromAddressLists,mail,c,l,postalCode,telephoneNumber,facsimileTelephoneNumber,co,company,streetAddress,countryCode,mobile

    "CN=Beti Bet,OU=Suppliers Electrical,OU=External Email Contacts,DC=hn,DC=local",contact,4,Beti Bet,"CN=Person,CN=Schema,CN=Configuration,DC=hn,DC=local","CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists Container,CN=Harvey Norman,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=hn,DC=local",Beti Bet,Bet,Product Manager,Beti,Beti Bet,SMTP:Beti.Bet@bet.com,SMTP:Beti.Bet@beti.com,FALSE,electrical sales,1310720,"CN=Electrical Sales,CN=All Address Lists,CN=Address Lists Container,CN=Harvey Norman,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=hn,DC=local",FALSE,Beti.Bet@bet.com,SI,Ljubljana,1000,01-583-08-63,01-583-08-62,Slovenia,Bet d.o.o.,Litostrojska 48,705,041-352-828

     

     

     

     

    Every second attribute is underlined, so It is easier to read.

     

    OK now, I was able to import  addresses in Active Directory, but they didn`t show up in global address list even tough e-mail address was shown when "clicking" properties, that was the main purpose of importing them. 

     

    And I also checked what targetAddress means. It is suppose to be external e-mail, which is fine, because all the e-mails I am importing are external. Of course most probably I am mistaken, should I erase this attribute?

     

    Then I checked log-file for "Beti Bet" and It reported the value or attribute already exists. It is not possible that the value already exists, because Beti Bet is made up and was not imported before this import. So, there must be a problem with some attribute.

     

    Following is the log file:

     

    Connecting to "srvor2.hn.local"
    Logging in as current user using SSPI
    Importing directory from file "betibet.csv"
    Loading entries
    2: CN=Beti Bet,OU=Suppliers Electrical,OU=External Email Contacts,DC=hn,DC=local
    Attribute 0) objectClass: contact
    Attribute 1) instanceType: 4
    Attribute 2) name: Beti Bet
    Attribute 3) objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=hn,DC=local
    Attribute 4) objectGUID: CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists Container,CN=Harvey Norman,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=hn,DC=local
    Attribute 5) cn: Beti Bet
    Attribute 6) sn: Bet
    Attribute 7) description: Product Manager
    Attribute 8) givenName: Beti
    Attribute 9) displayName: Beti Bet
    Attribute 10) targetAddress: SMTP:Beti.Bet@beti.com
    Attribute 11) mAPIRecipient: FALSE
    Attribute 12) extensionAttribute1: electrical sales
    Attribute 13) internetEncoding: 1310720
    Attribute 14) showInAddressBook: CN=Electrical Sales,CN=All Address Lists,CN=Address Lists Container,CN=Harvey Norman,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=hn,DC=local
    Attribute 15) msExchHideFromAddressLists: FALSE
    Attribute 16) mail: Beti.Bet@bet.com
    Attribute 17) c: SI
    Attribute 18) l: Ljubljana
    Attribute 19) postalCode: 1000
    Attribute 20) telephoneNumber: 01-583-08-63
    Attribute 21) facsimileTelephoneNumber: 01-583-08-62
    Attribute 22) co: Slovenia
    Attribute 23) company: Bet d.o.o.
    Attribute 24) streetAddress: Litostrojska 48
    Attribute 25) countryCode: 705
    Attribute 26) mobile: 041-352-828

    Add error on line 2: Attribute Or Value Exists
    The server side error is "The specified attribute is already present on the object."
    0 entries modified successfully.
    An error has occurred in the program

    Now I am really troubled.

     

    Any suggestions?

     

    Thanks for your help and regards,

     

    Vasja

    (This message was modified 3 times because I was trying new attributes.)
    Tuesday, September 04, 2007 12:05 PM
  • You need to populate the "showinaddressbook"-property. I'm still searching for which value to add, need to look at the schema but I don't have a server available at the moment.

    Tuesday, September 04, 2007 3:52 PM
    Moderator
  • Hi Joachim!

     

    I taught I already populated "showinaddressbook" property.

     

    Following is a snap from import file:

     

    showInAddressBook

     

    "CN=Electrical Sales,CN=All Address Lists,CN=Address Lists Container,CN=Harvey Norman,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=hn,DC=local" 

     

    This properties values were copied from a contact that was inserted in active directory manually and the contact is shown in global address list.

     

    After copying the value and inserting It in the CSVs import file the following error occurred:

     

    Add error on line 2: Attribute Or Value Exists
    The server side error is "The specified attribute is already present on the object."
    0 entries modified successfully.
    An error has occurred in the program

     

    This is strange since the contact I was trying to import was fictional and completely new so It is not possible that contact itself is already present in AD. Since the report says tat the attribute is already present on the object I taught that I listed one of the attributes twice, but that was not the case (I checked like five times). Is it possible that some properties that are very much alike (like those shown below) some hove interfere with each other? That one of them is automatically populates the rest?

     

    DN: "CN=Beti Bet,OU=Suppliers Electrical,OU=External Email Contacts,DC=hn,DC=local"

    objectCategory:  "CN=Person,CN=Schema,CN=Configuration,DC=hn,DC=local"

    objectGUID:  "CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists Container,CN=Harvey Norman,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=hn,DC=local"

     showInAddressBook:   "CN=Electrical Sales,CN=All Address Lists,CN=Address Lists Container,CN=Harvey Norman,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=hn,DC=local" 

     

    These 4 properties are very much alike, could It be that they somehow interfere with each other and that is the cause of the error message "specified attribute already present on the object"?

     

    Regards,

     

    Vasja

    Wednesday, September 05, 2007 8:34 AM
  • You can't populate objectGUID since that value is calculated by the server upon creation of the contact. Remove that line and it'll probably work.

     

    I believe you'll have to edit the showInAddressBook value to match the DN of the contact too.

     

    Wednesday, September 05, 2007 8:50 AM
    Moderator
  • Hi Joachim,

     

    I did what you said. In the first attempt to import contact (with external e-mail that can be seen in GAL) with CSVDE I only removed objectGuid and in the second attempt I removed objectGuid and edited showInAddressBook to match the DN of the contact too. Shame, but none of them worked. But I think we are getting closer, this time the error report was diffrent (below).

     

    Add error on line 2: Object Class Violation
    The server side error is "The object class attribute must be specified."
    0 entries modified successfully.
    An error has occurred in the program.

     

    Now, in CVS file object class is specified (below is a snatch from that file)!

     

    objectClass: contact

     

    Since the import worked when I imported contact that wasn`t shown in GAL and that contact was also objectClass contact, I really can`t understand why this error occurred now (I checked for syntax errors several times).

     

    Import log (file were DN=showInAddressbook):

     

    Connecting to "srvor2.hn.local"
    Logging in as current user using SSPI
    Importing directory from file "BetiBet.csv"
    Loading entries
    2: CN=Beti Bet,OU=Suppliers Electrical,OU=External Email Contacts,DC=hn,DC=local
    Attribute 0) objectClass: contact
    Attribute 1) instanceType: 4
    Attribute 2) name: Beti Bet
    Attribute 3) objectCategory: CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists Container,CN=Harvey Norman,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=hn,DC=local
    Attribute 4) cn: Beti Bet
    Attribute 5) sn: Bet
    Attribute 6) description: Product Manager
    Attribute 7) givenName: Beti
    Attribute 8) displayName: Beti Bet
    Attribute 9) proxyAddresses: SMTP:Beti.Bet@bet.com
    Attribute 10) targetAddress: SMTP:Beti.Bet@beti.com
    Attribute 11) mAPIRecipient: FALSE
    Attribute 12) extensionAttribute1: electrical sales
    Attribute 13) internetEncoding: 1310720
    Attribute 14) showInAddressBook: CN=Beti Bet,OU=Suppliers Electrical,OU=External Email Contacts,DC=hn,DC=local
    Attribute 15) msExchHideFromAddressLists: FALSE
    Attribute 16) mail: Beti.Bet@bet.com
    Attribute 17) c: SI
    Attribute 18) l: Ljubljana
    Attribute 19) postalCode: 1000
    Attribute 20) telephoneNumber: 01-583-08-63
    Attribute 21) facsimileTelephoneNumber: 01-583-08-62
    Attribute 22) co: Slovenia
    Attribute 23) company: Bet d.o.o.
    Attribute 24) streetAddress: Litostrojska 48
    Attribute 25) countryCode: 705
    Attribute 26) mobile: 041-352-828

    Add error on line 2: Object Class Violation
    The server side error is "The object class attribute must be specified."
    0 entries modified successfully.
    An error has occurred in the program

     

    Again thanks for your effort so far!

    Regards,

     

    Vasja

    Thursday, September 06, 2007 8:56 AM
  • I'd recommend the following approach:

    Create a contact fulfilling all your requirements. Export that single contact with either LDIFDE or CSVDE. Note the format of the file and use it as a template.

    I managed to import contacts as I posted in my first post to your question, so it's a matter of trial and error. The easiest way of solving your problem is probably to create a contact to work from.
    Thursday, September 06, 2007 8:41 PM
    Moderator
  • I have answered the original question by posting the following TechNet Wiki article

    http://social.technet.microsoft.com/wiki/contents/articles/how-to-import-mail-contact-into-active-directory-using-csvde.aspx

    That article gives you an example. The quick answer is that a mail contact requires

    DN,objectClass,mail

    That is all! :-)

    Friday, January 14, 2011 1:32 AM