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?

ago by (2.2k points)

1 Answer

0 votes
ago by (215k 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 by richarddewis (1.5k 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 (5.6k points)
0 votes
1 answer

Hello again! I've built a script to make a few Security Roles. I need to set the read permission to OUs in the script and I think I'm having an issue. I went into ... . Did I get the wrong GUID or am I doing something wrong in the script? Thanks again!

asked Nov 18, 2015 by drew.tittle (4.5k points)
0 votes
1 answer

How can create a Mail-User (Contact) in Exchange. ? Thanks

asked Jul 24, 2019 by davidotz8 (710 points)
0 votes
0 answers

Hello, I've got strange issue. I cannot use mail contact to forward emails to from 365 mailbox. I get this error: We are in Hybrid exchange. Mail contacts are ... be successfully done in Exchange Online, but not through Adaxes. Where the issue might be?

asked May 6, 2019 by DLe (3.9k points)
2,241 questions
2,002 answers
5,483 comments
17,025 users