// Token: 0x06005A96 RID: 23190 RVA: 0x0013DDB8 File Offset: 0x0013BFB8 internal PublicDatabasePresentationObject(ADPublicDatabase dataObject) : base(dataObject) { }
// Token: 0x060003B5 RID: 949 RVA: 0x00015440 File Offset: 0x00013640 internal static ADObject CreateAndInitializeRecipientObject <TRecipientObject>(ADPropertyBag propertyBag, ADRawEntry dummyObject, IRecipientSession recipientSession) where TRecipientObject : IConfigurable, new() { ArgumentValidator.ThrowIfNull("propertyBag", propertyBag); ArgumentValidator.ThrowIfNull("dummyObject", dummyObject); MultiValuedProperty <string> multiValuedProperty = (MultiValuedProperty <string>)propertyBag[ADObjectSchema.ObjectClass]; ADObject adobject; if (dummyObject is OWAMiniRecipient) { adobject = new OWAMiniRecipient(); } else if (dummyObject is ActiveSyncMiniRecipient) { adobject = new ActiveSyncMiniRecipient(); } else if (dummyObject is StorageMiniRecipient) { adobject = new StorageMiniRecipient(); } else if (dummyObject is TransportMiniRecipient) { adobject = new TransportMiniRecipient(); } else if (dummyObject is LoadBalancingMiniRecipient) { adobject = new LoadBalancingMiniRecipient(); } else if (dummyObject is MiniRecipientWithTokenGroups) { adobject = new MiniRecipientWithTokenGroups(); } else if (dummyObject is FrontEndMiniRecipient) { adobject = new FrontEndMiniRecipient(); } else if (dummyObject is MiniRecipient) { adobject = new MiniRecipient(); } else if (dummyObject is RemovedMailbox) { adobject = new RemovedMailbox(); } else if (dummyObject is DeletedRecipient) { adobject = new DeletedRecipient(); } else if (multiValuedProperty.Contains(ADComputerRecipient.MostDerivedClass)) { adobject = new ADComputerRecipient(); } else if (multiValuedProperty.Contains(ADUser.MostDerivedClass)) { adobject = new ADUser(); } else if (multiValuedProperty.Contains(ADContact.MostDerivedClass)) { adobject = new ADContact(); } else if (multiValuedProperty.Contains(ADGroup.MostDerivedClass)) { adobject = new ADGroup(); } else if (multiValuedProperty.Contains(ADDynamicGroup.MostDerivedClass)) { adobject = new ADDynamicGroup(); } else if (multiValuedProperty.Contains(ADPublicFolder.MostDerivedClass)) { adobject = new ADPublicFolder(); } else if (multiValuedProperty.Contains(ADSystemAttendantMailbox.MostDerivedClass)) { adobject = new ADSystemAttendantMailbox(); } else if (multiValuedProperty.Contains(ADSystemMailbox.MostDerivedClass)) { adobject = new ADSystemMailbox(); } else if (multiValuedProperty.Contains(ADPublicDatabase.MostDerivedClass)) { adobject = new ADPublicDatabase(); } else { if (!multiValuedProperty.Contains(ADMicrosoftExchangeRecipient.MostDerivedClass)) { string objectClass = string.Empty; foreach (string text in multiValuedProperty) { objectClass = text; } ObjectValidationError error = new ObjectValidationError(DirectoryStrings.UnsupportedObjectClass(objectClass), (ADObjectId)propertyBag[ADObjectSchema.Id], string.Empty); ADProviderPerf.UpdateProcessCounter(Counter.ProcessRateCriticalValidationFailures, UpdateType.Update, 1U); Globals.LogEvent(DirectoryEventLogConstants.Tuple_DSC_EVENT_VALIDATION_FAILED_FCO_MODE_RECIPIENT, ((ADObjectId)propertyBag[ADObjectSchema.Id]).ToString(), new object[] { ((ADObjectId)propertyBag[ADObjectSchema.Id]).ToDNString() }); throw new DataValidationException(error); } adobject = new ADMicrosoftExchangeRecipient(); } adobject.m_Session = recipientSession; adobject.propertyBag = propertyBag; adobject.Initialize(); adobject.ResetChangeTracking(true); if (recipientSession != null) { adobject.SetIsReadOnly(recipientSession.ReadOnly); } ExTraceGlobals.ADReadDetailsTracer.TraceDebug <string, RecipientType>((long)((recipientSession != null) ? recipientSession.GetHashCode() : 0), "ADRecipientObjectSession::CreateObject - Got {0} as {1}", adobject.DistinguishedName, (RecipientType)adobject[ADRecipientSchema.RecipientType]); return(adobject); }
protected void ResolveDatabaseAndServer() { DatabaseIdParameter databaseIdParameter = this.Database; ServerIdParameter serverIdParameter = this.Server ?? new ServerIdParameter(); ActiveManager activeManagerInstance = ActiveManager.GetActiveManagerInstance(); if (this.Identity != null) { bool flag = false; if (this.isRunningLogonStatisticsTask) { TIdentity tidentity = this.Identity; IEnumerable <Database> objects = tidentity.GetObjects <Database>(null, base.GlobalConfigSession); foreach (Database item in objects) { this.databases.Add(item); } if (this.databases.Count > 0) { if (this.databases[0].Server == null) { string name = typeof(Database).Name; TIdentity tidentity2 = this.Identity; base.WriteError(new MdbAdminTaskException(Strings.ErrorInvalidObjectMissingCriticalProperty(name, tidentity2.ToString(), DatabaseSchema.Server.Name)), ErrorCategory.InvalidArgument, this.Identity); } DatabaseLocationInfo serverForDatabase = activeManagerInstance.GetServerForDatabase(this.databases[0].Guid); serverIdParameter = ServerIdParameter.Parse(serverForDatabase.ServerFqdn); if (string.IsNullOrEmpty(this.databases[0].ExchangeLegacyDN)) { string name2 = typeof(Database).Name; TIdentity tidentity3 = this.Identity; base.WriteError(new MdbAdminTaskException(Strings.ErrorInvalidObjectMissingCriticalProperty(name2, tidentity3.ToString(), DatabaseSchema.ExchangeLegacyDN.Name)), ErrorCategory.InvalidArgument, this.Identity); } this.identity = new MailboxId(this.databases[0].ExchangeLegacyDN); flag = true; } } if (!flag) { IIdentityParameter id = this.Identity; IConfigDataProvider session = this.readOnlyRecipientSession; ObjectId rootID = null; TIdentity tidentity4 = this.Identity; LocalizedString? notFoundError = new LocalizedString?(Strings.ErrorMailboxNotFound(tidentity4.ToString())); TIdentity tidentity5 = this.Identity; ADRecipient adrecipient = (ADRecipient)base.GetDataObject <ADRecipient>(id, session, rootID, notFoundError, new LocalizedString?(Strings.ErrorMailboxNotUnique(tidentity5.ToString()))); Guid guid = Guid.Empty; string mailboxExchangeLegacyDn = null; ADObjectId adobjectId = null; if (string.IsNullOrEmpty(adrecipient.LegacyExchangeDN)) { string name3 = typeof(ADRecipient).Name; TIdentity tidentity6 = this.Identity; base.WriteError(new MdbAdminTaskException(Strings.ErrorInvalidObjectMissingCriticalProperty(name3, tidentity6.ToString(), ADRecipientSchema.LegacyExchangeDN.Name)), ErrorCategory.InvalidArgument, this.Identity); } ADUser aduser = adrecipient as ADUser; ADSystemMailbox adsystemMailbox = adrecipient as ADSystemMailbox; ADSystemAttendantMailbox adsystemAttendantMailbox = adrecipient as ADSystemAttendantMailbox; ADPublicDatabase adpublicDatabase = adrecipient as ADPublicDatabase; if (aduser != null) { if (this.isRunningMailboxStatisticsTask && aduser.RecipientTypeDetails == RecipientTypeDetails.AuditLogMailbox && !this.GetAuditLogMailboxStatistics()) { TIdentity tidentity7 = this.Identity; base.WriteError(new MdbAdminTaskException(Strings.RecipientNotFoundException(tidentity7.ToString())), ErrorCategory.InvalidArgument, null); } bool archiveMailboxStatistics = this.GetArchiveMailboxStatistics(); if (aduser.RecipientType == RecipientType.MailUser && !archiveMailboxStatistics) { base.WriteError(new MdbAdminTaskException(Strings.RecipientTypeNotValid(aduser.ToString())), (ErrorCategory)1003, this.Identity); } RecipientIdParameter recipientIdParameter = this.Identity as RecipientIdParameter; if (this.isRunningMailboxStatisticsTask && recipientIdParameter != null && recipientIdParameter.RawMailboxGuidInvolvedInSearch != Guid.Empty && aduser.MailboxLocations != null) { IMailboxLocationInfo mailboxLocation = aduser.MailboxLocations.GetMailboxLocation(recipientIdParameter.RawMailboxGuidInvolvedInSearch); if (mailboxLocation != null) { guid = mailboxLocation.MailboxGuid; adobjectId = mailboxLocation.DatabaseLocation; } } if (guid == Guid.Empty || adobjectId == null) { if (archiveMailboxStatistics) { if (aduser.ArchiveGuid != Guid.Empty) { if (aduser.ArchiveDomain != null) { base.WriteError(new MdbAdminTaskException(Strings.ErrorRemoteArchiveNoStats(aduser.ToString())), (ErrorCategory)1003, this.Identity); } else { guid = aduser.ArchiveGuid; adobjectId = (aduser.ArchiveDatabase ?? aduser.Database); } } else { base.WriteError(new MdbAdminTaskException(Strings.ErrorArchiveNotEnabled(aduser.ToString())), ErrorCategory.InvalidArgument, this.Identity); } } else { guid = aduser.ExchangeGuid; adobjectId = aduser.Database; } } mailboxExchangeLegacyDn = aduser.LegacyExchangeDN; } else if (adsystemMailbox != null) { guid = adsystemMailbox.ExchangeGuid; mailboxExchangeLegacyDn = adsystemMailbox.LegacyExchangeDN; adobjectId = adsystemMailbox.Database; } else if (adsystemAttendantMailbox != null) { guid = adsystemAttendantMailbox.Guid; mailboxExchangeLegacyDn = adsystemAttendantMailbox.LegacyExchangeDN; adobjectId = adsystemAttendantMailbox.Database; } else if (adpublicDatabase != null) { mailboxExchangeLegacyDn = adpublicDatabase.LegacyExchangeDN; adobjectId = (ADObjectId)adpublicDatabase.Identity; } if (adobjectId == null) { string name4 = adrecipient.GetType().Name; TIdentity tidentity8 = this.Identity; base.WriteError(new MdbAdminTaskException(Strings.ErrorInvalidObjectMissingCriticalProperty(name4, tidentity8.ToString(), IADMailStorageSchema.Database.Name)), ErrorCategory.InvalidArgument, adrecipient); } databaseIdParameter = new DatabaseIdParameter(adobjectId); if (this.isRunningLogonStatisticsTask) { this.identity = new MailboxId(mailboxExchangeLegacyDn); } else { this.identity = new MailboxId(MapiTaskHelper.ConvertDatabaseADObjectIdToDatabaseId(adobjectId), guid); } } } if (databaseIdParameter != null) { databaseIdParameter.AllowLegacy = true; LocalizedString empty = LocalizedString.Empty; LocalizedString empty2 = LocalizedString.Empty; Database database; if (this.isRunningLogonStatisticsTask) { database = (Database)base.GetDataObject <Database>(databaseIdParameter, base.GlobalConfigSession, null, new LocalizedString?(Strings.ErrorDatabaseNotFound(databaseIdParameter.ToString())), new LocalizedString?(Strings.ErrorDatabaseNotUnique(databaseIdParameter.ToString()))); } else { database = (MailboxDatabase)base.GetDataObject <MailboxDatabase>(databaseIdParameter, base.GlobalConfigSession, null, new LocalizedString?(Strings.ErrorMailboxDatabaseNotFound(databaseIdParameter.ToString())), new LocalizedString?(Strings.ErrorMailboxDatabaseNotUnique(databaseIdParameter.ToString()))); } if (database.Server == null) { base.WriteError(new MdbAdminTaskException(Strings.ErrorInvalidObjectMissingCriticalProperty(this.isRunningLogonStatisticsTask ? typeof(Database).Name : typeof(MailboxDatabase).Name, databaseIdParameter.ToString(), DatabaseSchema.Server.Name)), ErrorCategory.InvalidArgument, database); } this.databases = new List <Database>(new Database[] { database }); if (this.CopyOnServer != null) { serverIdParameter = this.CopyOnServer; } else { DatabaseLocationInfo serverForDatabase = activeManagerInstance.GetServerForDatabase(database.Guid); serverIdParameter = ServerIdParameter.Parse(serverForDatabase.ServerFqdn); } } if (this.Server != null) { serverIdParameter = this.Server; this.server = MapiTaskHelper.GetMailboxServer(this.Server, base.GlobalConfigSession, new Task.ErrorLoggerDelegate(base.WriteError)); } else { this.server = (Server)base.GetDataObject <Server>(serverIdParameter, base.GlobalConfigSession, null, new LocalizedString?((this.Identity == null && this.Database == null) ? Strings.ErrorLocalMachineIsNotExchangeServer : Strings.ErrorServerNotFound(serverIdParameter.ToString())), new LocalizedString?(Strings.ErrorServerNotUnique(serverIdParameter.ToString()))); if (!this.server.IsExchange2007OrLater || !this.server.IsMailboxServer) { if (this.Identity != null) { TIdentity tidentity9 = this.Identity; base.WriteError(new MdbAdminTaskException(Strings.ErrorMailboxInNonMailboxServer(tidentity9.ToString())), ErrorCategory.InvalidArgument, this.server); } if (this.Database != null) { base.WriteError(new MdbAdminTaskException(Strings.ErrorDatabaseInNonMailboxServer(this.Database.ToString())), ErrorCategory.InvalidArgument, this.server); } base.WriteError(new MdbAdminTaskException(Strings.ErrorLocalServerIsNotMailboxServer), ErrorCategory.InvalidArgument, this.server); } } if (string.IsNullOrEmpty(this.server.ExchangeLegacyDN)) { base.WriteError(new MdbAdminTaskException(Strings.ErrorInvalidObjectMissingCriticalProperty(typeof(Server).Name, serverIdParameter.ToString(), ServerSchema.ExchangeLegacyDN.Name)), ErrorCategory.InvalidArgument, this.Identity); } if (this.databases.Count == 0) { if (this.isRunningLogonStatisticsTask) { this.FilterActiveDatabases(activeManagerInstance, this.server.GetDatabases()); return; } this.FilterActiveDatabases(activeManagerInstance, this.server.GetMailboxDatabases()); } }