@schiffne You could write an EA that determines if a local user account has a space in the username and base your smart group on the response of the EA.
that´s a good idea, but the EA inventory kicks in to late to exclude them from the policy "Run when Enrollement Complete"
...the EA inventory kicks in to late to exclude them from the policy...
So would any Smart Group since that's going to be based on inventory information, which would only get collected after enrollment.
Backing up a moment, I'm curious how users are ending up with spaces in their short name to begin with, since the OS generally does not allow that unless the account is modified after the fact via the command line or something.
Or are you talking about the full name and not the short name? If so, why is it an issue they have a space in their full name? What's the problem you're attempting to solve by having them rename that?
Apple does not officially support a space in the name, but if you DEP enrollement and bundle it with your SAMAccountName (which contains a space), than you run into this issue.
@schiffne How are you intending for the user to change their name? While it's straightforward to change the Full Name for an account, it's much more complicated to change the account name/short name which is what Jamf refers to as the Username.