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

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)
0 votes
1 answer

Hello, We really like the new Azure AD functionality in Adaxes. Is it possible (or planned) to managed Azure AD Custom Security Attributes (currently in Preview) using Adaxes? We have ... an AAD only user so we'd like to start with Azure attrbiutes if we can.

asked Dec 9, 2022 by Gavin.Raymen (40 points)
0 votes
1 answer

Hi I know this isn't currently possible, but is the ability to use Adaxes custom attributes in a Business Unit Criteria something you are looking into? It would make the business units far more powerful and usable than they currently are. Thanks Matt

asked Nov 30, 2022 by chappers77 (2.0k points)
3,340 questions
3,041 answers
7,764 comments
544,924 users