0 votes

This is the first time I have created a new user with the newest release and I encountered this error when the commands tried to create the mailbox:

Property expression "martinJ" isn't valid. Valid values are: Strings that includes '@', where '@' cannot be the last character Property Name: UserPrincipalName

I haven't changed any of the property patterns, and I don't see one specifically for the error I've encountered.

By the way, this happens if I manually invoke the Exchange task to create a new mailbox.

by (470 points)
0

Here is more information on this issue...

Actually, the mailbox creation fails even directly in Exchange, and the cause is because of an incomplete UPN. This is easily corrected in ADUC on the account tab of the user account. Just pop the domain in the dropdown menu and save it. Once done, all is good again.

However, we see this happening whenever new accounts get created in Adaxes. Whenever the uniqueness script checks and must alter the username due to non-uniqueness, the account gets created without the UPN suffix for some reason.

I hope that helps troubleshoot the issue, as we do encounter this often.

1 Answer

0 votes
by (216k points)

Hello,

Did you take the username uniqueness script from the Validate/Modify User Input Using a Script Tutorial? If so, there's a small bug in the sample script. It doesn't set the User Logon Name property correctly. Here's a modified version of the script that adds a UPN suffix to the User Logon Name:

Import-Module Adaxes

function IsUserNameUnique($username)

{
   $user = Get-AdmUser $username -erroraction silentlycontinue
   return $user -eq $Null;
}

# Get the username
$username = $Context.GetModifiedPropertyValue("samAccountName");

# Check if the username is unique
if (IsUserNameUnique($username))
{
    return;
}

# If the username is not unique, generate a unique one
$uniqueUsername = $Null;
for ($i = 1; $True; $i++)
{
    $uniqueUsername = $username + $i;
    if (IsUserNameUnique($uniqueUsername))
    {
        break;
    }
}

# Update User Logon Name (pre-Windows 2000)
$Context.SetModifiedPropertyValue("samAccountName", $uniqueUsername)

# Get domain name
$domaiName = $Context.GetObjectDomain("%distinguishedName%")

# Update User Logon Name
$Context.SetModifiedPropertyValue("userPrincipalName", "$uniqueUsername@$domaiName");
$Context.LogMessage("The username been changed to " + "$uniqueUsername@$domaiName" `
+ ".", "Information")

Setting unique usernames with the modified script should correct the issue.

0

Perfect! Actually our uniqueness script was customized with Adaxes support last year and this will eliminate this troublesome bug.

Thanks!

Related questions

0 votes
1 answer

Hi Again, I'm configuring our new Adaxes platform 2013.1 and I have the following error during mailbox creation through admin console and web interface : "Microsoft Exchange is ... ...) through admin console. Any idea ? Thanks for your precious help Regards

asked Oct 7, 2013 by smasset (740 points)
0 votes
1 answer

I'm trying to modify mailbox settings to add additional email addresses to a user after creation. This is a hybrid on-prem and Exchange Online with E5 licenses. Everything works up ... to a different OU during the process so I know the user exists. Any ideas?

asked Mar 6, 2023 by Michael Long (70 points)
0 votes
1 answer

We were wondering if Adaxes has a script available to create AS400 accounts during the AD creation. This will allow us to totally automate the new hire process going forward.

asked Jan 26, 2017 by willy-wally (3.2k points)
0 votes
1 answer

We have a business need for automating and controlling the creation of service accounts in our AD. For example, we want all new service accounts to start with "svc_" for ... customize the "New User" form to create a "New Service Account" workflow in Adaxes?

asked Sep 10, 2021 by joshua.lapchuk (60 points)
0 votes
1 answer

Hi, Was wondering if there's a nice way to manually or automatically check if a username or an extension is in use before creating a user? What do other people do? ... in the results, deleting the user and starting again - but would rather the checks first.

asked Feb 25, 2016 by AdamFowlerIT (120 points)
3,351 questions
3,052 answers
7,791 comments
545,083 users