0 votes

Feeling lost here, because using the exact syntax from example #4 here gives me a Set-AdmObject: One or more input parameters are invalid error when I try to pass an array of values:

$values = "value1", "value2"
Set-AdmObject -Identity <guid> -Replace @{adm-CustomAttributeTextMultiValue2=$values}

If I pass it a single string, it works as expected:

$value = "value1"
Set-AdmObject -Identity <guid> -Replace @{adm-CustomAttributeTextMultiValue2=$value}

Adaxes Version 3.16.21906.0

by (290 points)

1 Answer

–1 vote
by (289k points)

Hello,

Your approach is incorrect as $values is actually not an array like in the examples you referenced. To achieve the desired, you can change the variable definition as follows:

$values = @("value1", "value2")
0

So both are perfectly valid ways of creating an array. The @() syntax coerces single values into arrays.

$values = "value1","value2"
$values.GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     Object[]                                 System.Array

Related questions

0 votes
1 answer

Hi, I need to start Adaxes scheduled task from Powershell console running on another host. How can I do that?

asked May 21, 2020 by KIT (960 points)
0 votes
1 answer

Hi I've added values to two attributes of an Oraganization Unit: adm-CustomAttributeText1 adm-CustomAttributeText2 I'm trying to extract these properties with a powershell ... But this does not provide the value set in adm-CustomAttributeText1. Any ideas?

asked Jan 28, 2013 by kjesoo (960 points)
0 votes
1 answer

Hello Adaxes Support, I couldn't find a script to enable MessageCopyForSentAsEnabled for a shared mailbox, do you have a script for me to do that?

asked May 22 by dominik.stawny (280 points)
0 votes
1 answer

When trying to set "Accept Messages" to "All senders" on distribution group through Adaxes web interface I get error: Adaxes doesn't have any permissions to ... of mentioned role? I tried give it msExchRequireAuthToSendTo permission but that didn't help.

asked Dec 1, 2022 by KIT (960 points)
0 votes
1 answer

Im looking for a way to set a global variable that can be called across multiple powershell scripts

asked Jun 11 by Keonip (180 points)
3,548 questions
3,238 answers
8,232 comments
547,814 users