0 votes

I'm learning the Adaxes powershell methods for creating objects.

I would like to create a contact that is mail enabled.

I attempted to use the example but it failed to create the contact in the correct location.

The example from the online help shows. https://www.adaxes.com/sdk/New-AdmObject/

New-AdmObject -Name testSaraDavisContact -Type "contact" -OtherAttributes @{'msDS-SourceObjectDN'="OU=Contacts,OU=Japan,DC=DC1,DC=DOMAIN,DC=com"} -AdaxesService USCPADAXES01 -Credential $myCredentials

I must have misunderstood what the OtherAttributes is for. I was trying to create the object in a specific OU and it ended up in a different domain and not in an OU at all and no error.

Can you provide a better example of how to create a mail enabled contact with PowerShell using the New-AdmObject?

by (810 points)

1 Answer

0 votes
by (216k points)

Hello,

I must have misunderstood what the OtherAttributes is for.

The -OtherAttributes parameter is for specifying values for attributes that are not represented by other parameters of the cmdlet. The msDS-SourceObjectDN attribute in the parameter does not specify location of the new object.

I was trying to create the object in a specific OU and it ended up in a different domain and not in an OU at all and no error.

To create the object in a specific OU of a specific domain, you should use the -Path and -Server parameters respectively.

Can you provide a better example of how to create a mail enabled contact with PowerShell using the New-AdmObject?

To create mail-enabled contacts you should connect to Exchange and then use the New-MailContact cmdlet.

Related questions

0 votes
1 answer

I've got the following script as part of a larger piece where param-members is an AD Object picker list seperated by a ' ; ' currently: New-DistributionGroup -Name ... or convert that to username but I'm struggling to achieve that with multiple Users selected

asked Jan 27, 2020 by richarddewis (260 points)
0 votes
1 answer

Dear support, We are trying to achieve a situation where a user will be able to do the following: Create a mail enabled Office 365 contact. Add this office 365 contact to a ... . Hopefully you can help me on this quest. Thanks a lot and kind regards, Remco.

asked Feb 11, 2021 by remcobraspenning (20 points)
0 votes
1 answer

I would like to configure a scheduled report to send to a mail contact object. However, these mail contact objects are not showing up when I try to set them as the recipients. Is this possible or is there another way to go about this?

asked Jun 19 by scoutcor (180 points)
0 votes
0 answers

Hello, I want to automate the creation of a contact based on an existing AD Users. For example, the code in my custom command contains something like: new-mailcontact - ... a parameter after he run the Custom Command from the Web interface? Thanks in advance.

asked Apr 20, 2016 by tentaal (1.1k points)
0 votes
1 answer

Hi, I am trying to set forwarding for a shared mailbox to a contact. Adaxes is not able to find any contact? I tried to search by name and then selected OU itself, but no objects found. Best Christian

asked Nov 27, 2023 by wintec01 (2.0k points)
3,716 questions
3,396 answers
8,588 comments
549,930 users