Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProxyAddress transforms logic #64

Open
pawill1973 opened this issue Mar 21, 2025 · 1 comment
Open

ProxyAddress transforms logic #64

pawill1973 opened this issue Mar 21, 2025 · 1 comment

Comments

@pawill1973
Copy link

Describe the bug
When querying users I see many errors from the Transform module in relation to the proxyAddresses attribute of contact objects.

To Reproduce
Query the directory for mail objects that have a proxyAddresses value that contains something like this:
SMTP:[email protected]; NOTES:John Amith1/Certifier@ICEB; X400:c=GB;a= ;p=IB;o=ICAO;s=Smith2;g=John;;

Note the empty/blank value at the end (between the two semi-colons)

Expected behavior
For consideration - in my case there are three valid and one invalid entries in the proxyAddresses attribute. This is the account forest, Exchange existed in the resource forest. I don't think you should spew red errors to the console. I think an orange warning saying there's some rubbish in the proxyAddresses would be better. Take the values, handle the "error" (bad data really - I have no idea how we got into this state).

Or better yet, if there's more than one value in proxyAddresses why bother the user at all - just ignore/bin the empty value. Is it even worth outputting that there's rubbish there?

Environment (please complete the following information):

  • OS: Windows Server 2022
  • PowerShell version 5.1.20348.2849
  • S.DS.P Module version 2.2.1
  • The target AD environment is older though :) -- Server 2012 R2 AD DS, Exchange Server 8.3 and 15.0 don't complain when calling Get-MailUser or Get-Mailbox
@jformacek
Copy link
Owner

Well, I looked at the code and: when invalid entry in multival attr --> transform logic throws and nothing returned in the attr. This is something I wanted to improve.
However, I did not want to just silently ignore invalid entries, not telling caller that something is wrong.

So I went the way of design intention of PowerShell engine and added better support for ErrorActionPreference in Find-LdapObject:

  • Stop just throws on first invalid entry
  • Continue writes errors but continues processing
  • SilentlyContinue just swallows the errors and ignores invalid entries

What I'm still thinking about is the scope of ErrorActionPreference as I feel it might be too wide - setting to SilentlyContinue will just hide all errors encountered when querying, not only invalid attribute errors, which might not be suitable for every scenario.

Thoughts?

Anyway, experimental handling for proxyAddress transform is in 2.2.2-beta1 - please test / play with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants