Поделиться через


TfsConfigurationServer - конструктор (RegisteredConfigurationServer, IdentityDescriptor)

Инициализирует новый экземпляр объекта TfsConfigurationServer с использованием сведений о регистрации на локальном компьютере и олицетворения идентификатором из IIdentityManagementService.

Пространство имен:  Microsoft.TeamFoundation.Client
Сборка:  Microsoft.TeamFoundation.Client (в Microsoft.TeamFoundation.Client.dll)

Синтаксис

'Декларация
Public Sub New ( _
    application As RegisteredConfigurationServer, _
    identityToImpersonate As IdentityDescriptor _
)
public TfsConfigurationServer(
    RegisteredConfigurationServer application,
    IdentityDescriptor identityToImpersonate
)

Параметры

Заметки

Зарегистрированные серверы конфигурации можно получить с помощью RegisteredTfsConnections.GetConfigurationServers.

Чтобы запустить код, использующий этот конструктор, процесс должен иметь запросы от чужого имени «выполнить» разрешение.Дополнительные сведения о заимствовании прав см. в разделе Acting on Behalf of Another User (Impersonation).

// Get the servers registered on this computer
RegisteredConfigurationServer[] servers = RegisteredTfsConnections.GetConfigurationServers();

// Connect to the first one in the array without impersonation
TfsConfigurationServer baseUserConnection = new TfsConfigurationServer(servers[0]);

// Get the identity management service
IIdentityManagementService ims = baseUserConnection.GetService<IIdentityManagementService>();

// Get the identity to impersonate
TeamFoundationIdentity identity = ims.ReadIdentity(IdentitySearchFactor.AccountName, @"DOMAIN\user",
   MembershipQuery.None, ReadIdentityOptions.None); 

// Connect using the impersonated identity
TfsConfigurationServer impersonatedConnection = new TfsConfigurationServer(servers[0], 
   identity.Descriptor);

Безопасность платформы .NET Framework

См. также

Ссылки

TfsConfigurationServer Класс

TfsConfigurationServer - перегрузка

Microsoft.TeamFoundation.Client - пространство имен

Другие ресурсы

Подключение к серверу Team Foundation Server из консольного приложения

Acting on Behalf of Another User (Impersonation)