protected override void InternalBeginProcessing() { TaskLogger.LogEnter(); LocalizedString empty = LocalizedString.Empty; this.Name = MailboxTaskHelper.GetNameOfAcceptableLengthForMultiTenantMode(this.Name, out empty); if (empty != LocalizedString.Empty) { this.WriteWarning(empty); } base.InternalBeginProcessing(); if (this.Organization == null) { if (base.CurrentOrganizationId == OrganizationId.ForestWideOrgId) { base.WriteError(new ArgumentException(Strings.ErrorOrganizationParameterRequired), ErrorCategory.InvalidOperation, null); } else { this.Organization = new OrganizationIdParameter(base.CurrentOrganizationId.OrganizationalUnit.Name); } } base.CurrentOrganizationId = this.ResolveCurrentOrganization(); OrganizationTaskHelper.ValidateParamString("Name", this.Name, new Task.TaskErrorLoggingDelegate(base.WriteError)); if (base.Fields["AuthenticationType"] == null) { this.AuthenticationType = AuthenticationType.Managed; } if (base.Fields["LiveIdInstanceType"] == null) { this.LiveIdInstanceType = LiveIdInstanceType.Consumer; } base.Fields["OutBoundOnly"] = this.OutBoundOnly; base.Fields["MakeDefault"] = this.MakeDefault; string value = string.Empty; if (this.Organization != null) { PartitionId partitionIdByAcceptedDomainName = ADAccountPartitionLocator.GetPartitionIdByAcceptedDomainName(this.Organization.RawIdentity); if (partitionIdByAcceptedDomainName != null) { value = base.ServerSettings.PreferredGlobalCatalog(partitionIdByAcceptedDomainName.ForestFQDN); } } base.Fields["PreferredServer"] = value; TaskLogger.LogExit(); }