I'm working on a script to streamline the onboarding process, and I've made good progress. However, I keep hitting this error that says, 'A Value for the attribute was not in the acceptable range of values.' I think it's related to the address section of a new Active Directory user. I'm pretty sure it's the street address causing the issue, but I'm unsure about the specific problem. The script pulls data from an Excel sheet and displays it correctly, so any tips on how to troubleshoot this would be greatly appreciated!
3 Answers
Could you share a snippet of your code? It might help to pinpoint the issue. You could be using the wrong attribute name for the address.
It would help if you could show a simplified version of your code. This could reveal if you’re missing something or using incorrect syntax for the new-aduser or set-aduser commands.
The error often means that the format of the data you’re trying to input isn’t acceptable for AD. Double-check the length of the string you're using; it might be too long. Also, confirm it's the street address field—some users have encountered similar problems with the Country field, which only accepts two-letter codes (like ‘GB’ instead of ‘UK’).
That was it! The country field was the culprit, and once I removed that line from my code, everything else filled out perfectly. Thanks a ton!