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 (228k 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

Is it possible to add Exchange custom attributes to users self-service portal and allow users to edit/modify them? Background, we're looking at setting up Office ... service account to perform the updates. We would prefer not changing permissions if possible.

asked Sep 15 by Subz (20 points)
0 votes
1 answer

I am wanting to export a list of users including the properties of a specific custom attribute. Ideally, I would be able to run a get-admuser and filter on a custom attribute, but even an excel report with the custom attributes would work. Is this possible?

asked Sep 9, 2021 by ggallaway (300 points)
0 votes
1 answer

Hi I'm wondering how we can use the custom attributes we can set when creating a new container in Adaxes? As an example, I would like to use one for the ... how would we go about updating the attribute once the certificate has been renewed? Thanks Matt

asked Apr 28, 2021 by chappers77 (1.2k points)
0 votes
1 answer

Hi We've currently have 2 instances of Adaxes running in our environment. The first is a legacy standalone system and the new is a HA environment. We needed to get some things ... system so that it can be wiped and rebuilt. Is tihs possible at all? Thanks Matt

asked Nov 12, 2020 by chappers77 (1.2k points)
0 votes
1 answer

Is there a way to edit the names of custom fields in forms? For example, I want to create a new field but my only option is use the name Extension Attribute 12. ... rename them within Adaxes so our help desk staff don't get confused when creating profiles.

asked Nov 20, 2018 by john.morrow (250 points)
2,803 questions
2,538 answers
6,609 comments
63,865 users