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 (790 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
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 (1.5k points)
0 votes
1 answer

Is there no "mail enable" action for contacts by default? I was able to create a button but I was suprised there wasn't one already built-in.

asked Aug 28, 2020 by ComputerHabit (790 points)
3,588 questions
3,277 answers
8,303 comments
548,097 users