HR에서 MS Active Directory로 사용자 계정을 생성하는 DB Microsoft Identity Manager가 있습니다. 고유의 이메일을 생성하기위한 Microsoft Identity Manager 용 C#에서 고유 한 전자 메일 생성
는 내가 같은 코드를 가지고 :case "mailgenerate":
if (mventry["email"].IsPresent)
{
// Do nothing, the mail was already generated.
}
{
if (csentry["FIRST"].IsPresent && csentry["LAST"].IsPresent);
{
string FirstName = replaceRUEN(csentry["FIRST"].Value);
string LastName = replaceRUEN(csentry["LAST"].Value);
string email = FirstName + "." + LastName + "@test.domain.com";
string newmail = GetCheckedMail(email, mventry);
if (newmail.Equals(""))
{
throw new TerminateRunException("A unique mail could not be found");
}
mventry["email"].Value = newmail;
}
}
break;
//Generate mail Name method
string GetCheckedMail(string email, MVEntry mventry)
{
MVEntry[] findResultList = null;
string checkedmailName = email;
for (int nameSuffix = 1; nameSuffix < 100; nameSuffix++)
{
//added ; and if corrected
findResultList = Utils.FindMVEntries("email", checkedmailName,1);
if (findResultList.Length == 0)
{
// The current mailName is not in use.
return (checkedmailName);
}
MVEntry mvEntryFound = findResultList[0];
if (mvEntryFound.Equals(mventry))
{
return (checkedmailName);
}
// If the passed email is already in use, then add an integer value
// then verify if the new value exists. Repeat until a unique email is checked
checkedmailName = checkedmailName + nameSuffix.ToString();
}
// Return an empty string if no unique mailnickName could be created.
return "";
}
문제 : 처음 동기화주기를 실행하면 내가 [email protected] 다음의 경우처럼 정상적인 이메일을 동기화주기 [email protected]
이 코드 나는 또한 아무 문제없이 mailnickname 및 accountname을 생성하는 데 사용하고 있습니다.
왜 그런지 말할 수 있습니까? 감사합니다.
checkedmailName = checkedmailName + nameSuffix.ToString();
checkedmailName
이 같은 값이 있습니다 :