0 votes

I'm making use of a TextMultiValue property, but I'm frequently getting 2 errors when I execute $Context.TargetObject.GetEx("Adm-CustomAttributeMultiValue2"). These actions are taking place on a user, the user can only execute the action on themselves but I'm always seeing the following to errors:

  • Exception calling "GetEx" with "1" argument(s): "The 'Adm-CustomAttributeTextMultiValue2' property cannot be found in the cache." Stack trace: at <ScriptBlock>, <No file>: line 34
  • Cannot write to a closed TextWriter.

Line causing the issue:
$IPs = $Context.TargetObject.GetEx("Adm-CustomAttributeTextMultiValue2")

I'm seeing "Cannot write to a closed TextWriter" other times also, can I get any insight on what would cause that?

Thanks!

by (300 points)

1 Answer

0 votes
by (294k points)
selected by
Best answer

Hello Jake,

Exception calling "GetEx" with "1" argument(s): "The 'Adm-CustomAttributeTextMultiValue2' property cannot be found in the cache." Stack trace: at <ScriptBlock>, <No file>: line 34

The error occurs because the property is empty for the target object. To avoid such errors, you need to use try ... catch for getting property values.

Cannot write to a closed TextWriter.

For troubleshooting purposes, could you provide the full script you are using?

0

The error occurs because the property is empty for the target object. To avoid such errors, you need to use try ... catch for getting property values.

Strange - this is a value I'm setting as part of the update to the user's AD account. Currently my script runs "Before updating a user" is that related to why it isn't available? It seems like sometimes this part works and sometimes it doesn't.

Cannot write to a closed TextWriter.
For troubleshooting purposes, could you provide the full script you are using?

I don't always see this but I'll send you the code via direct message.

0

Hello Jake,

Strange - this is a value I'm setting as part of the update to the user's AD account. Currently my script runs "Before updating a user" is that related to why it isn't available?

Could you post here or send us (support[at]adaxes.com) a screenshot of the Business Rule configuration?

I don't always see this but I'll send you the code via direct message.

We provided an update to your script. Give it a try.

Related questions

0 votes
1 answer

I'm wanting to store information in a custom user attribute in Entra ID but I'm wondering if this is possible within a "Update the user" action in Adaxes? ... PowerShell? https://learn.microsoft.com/en-us/entra/external-id/customers/concept-user-attributes

asked Dec 11, 2024 by smcfarland (60 points)
0 votes
1 answer

Is there a way to configure a Custom Command parameter to accept multiple values so I can then add them to a multi value attribute such as adm-CustomAttributeObjectMultiValue1 ... in my specific case I'm looking to use a directory object picker parameter

asked Nov 27, 2024 by AM (50 points)
0 votes
1 answer

Hi all, we switched from an exchange hybrid model to online only. So we turned off our on-prem exchange server. After some tries we faced the following problem: After ... Will Adaxes recognize that there is no on-prem anymore? Thank you for helping us!

asked Nov 16, 2022 by robin.christmann (160 points)
0 votes
1 answer

Im trying to rename "Extension attribute 1 and 2" to something legible for users. Is there a way to cahnge the dsiaply name myslef like how other attributes are done?

asked Feb 17, 2023 by raul.ramirez (210 points)
0 votes
1 answer

Hi, I am looking to build a report whereby all users within a specific OU (Disabled and forwarding). The report will return users who have been inactive for 90 days along with ... do this. Could someone give me the script to be able to do this please? Thanks!

asked Dec 20, 2022 by gareth.aylward (180 points)
3,594 questions
3,281 answers
8,315 comments
548,246 users