DistributionPublisher.PublisherSecurity DistributionPublisher.PublisherSecurity DistributionPublisher.PublisherSecurity Property

정의

게시자에 연결할 때 복제 에이전트에서 사용하는 보안 컨텍스트를 가져옵니다. Gets the security context used by replication agent when connecting to the Publisher.

public:
 property Microsoft::SqlServer::Replication::ConnectionSecurityContext ^ PublisherSecurity { Microsoft::SqlServer::Replication::ConnectionSecurityContext ^ get(); };
public Microsoft.SqlServer.Replication.ConnectionSecurityContext PublisherSecurity { get; }
Public ReadOnly Property PublisherSecurity As ConnectionSecurityContext
속성 값

게시자에 연결할 때 복제 에이전트에서 사용하는 보안 컨텍스트입니다. The security context used by replication agent when connecting to the Publisher.

예제

// Set the server and database names
string distributionDbName = "distribution";
string publisherName = publisherInstance;
string publicationDbName = "AdventureWorks2012";

DistributionDatabase distributionDb;
ReplicationServer distributor;
DistributionPublisher publisher;
ReplicationDatabase publicationDb;

// Create a connection to the server using Windows Authentication.
ServerConnection conn = new ServerConnection(publisherName);

try
{
	// Connect to the server acting as the Distributor 
	// and local Publisher.
	conn.Connect();

	// Define the distribution database at the Distributor,
	// but do not create it now.
	distributionDb = new DistributionDatabase(distributionDbName, conn);
	distributionDb.MaxDistributionRetention = 96;
	distributionDb.HistoryRetention = 120;

	// Set the Distributor properties and install the Distributor.
	// This also creates the specified distribution database.
	distributor = new ReplicationServer(conn);
	distributor.InstallDistributor((string)null, distributionDb);

	// Set the Publisher properties and install the Publisher.
	publisher = new DistributionPublisher(publisherName, conn);
	publisher.DistributionDatabase = distributionDb.Name;
	publisher.WorkingDirectory = @"\\" + publisherName + @"\repldata";
	publisher.PublisherSecurity.WindowsAuthentication = true;
	publisher.Create();

	// Enable AdventureWorks2012 as a publication database.
	publicationDb = new ReplicationDatabase(publicationDbName, conn);

	publicationDb.EnabledTransPublishing = true;
	publicationDb.EnabledMergePublishing = true;
}
catch (Exception ex)
{
	// Implement appropriate error handling here.
	throw new ApplicationException("An error occured when installing distribution and publishing.", ex);
}
finally
{
	conn.Disconnect();
}
' Set the server and database names
Dim distributionDbName As String = "distribution"
Dim publisherName As String = publisherInstance
Dim publicationDbName As String = "AdventureWorks2012"

Dim distributionDb As DistributionDatabase
Dim distributor As ReplicationServer
Dim publisher As DistributionPublisher
Dim publicationDb As ReplicationDatabase

' Create a connection to the server using Windows Authentication.
Dim conn As ServerConnection = New ServerConnection(publisherName)

Try
    ' Connect to the server acting as the Distributor 
    ' and local Publisher.
    conn.Connect()

    ' Define the distribution database at the Distributor,
    ' but do not create it now.
    distributionDb = New DistributionDatabase(distributionDbName, conn)
    distributionDb.MaxDistributionRetention = 96
    distributionDb.HistoryRetention = 120

    ' Set the Distributor properties and install the Distributor.
    ' This also creates the specified distribution database.
    distributor = New ReplicationServer(conn)
    distributor.InstallDistributor((CType(Nothing, String)), distributionDb)

    ' Set the Publisher properties and install the Publisher.
    publisher = New DistributionPublisher(publisherName, conn)
    publisher.DistributionDatabase = distributionDb.Name
    publisher.WorkingDirectory = "\\" + publisherName + "\repldata"
    publisher.PublisherSecurity.WindowsAuthentication = True
    publisher.Create()

    ' Enable AdventureWorks2012 as a publication database.
    publicationDb = New ReplicationDatabase(publicationDbName, conn)

    publicationDb.EnabledTransPublishing = True
    publicationDb.EnabledMergePublishing = True

Catch ex As Exception
    ' Implement appropriate error handling here.
    Throw New ApplicationException("An error occured when installing distribution and publishing.", ex)

Finally
    conn.Disconnect()

End Try

설명

PublisherSecurity 속성은 트랜잭션 게시에 지연 업데이트 구독을 게시자에 연결 하는 복제 에이전트에 의해 또는와-SQL Server 이외 게시자에만 사용 됩니다.The PublisherSecurity property is only used by replication agents to connect to the Publisher for transactional publications with queued updating subscriptions, or with a non-SQL Server Publisher.

PublisherSecurity 속성은 읽기 전용입니다.The PublisherSecurity property is read-only. 반환 된 보안 속성을 설정 ConnectionSecurityContext 개체와 호출 후 Update합니다.Set the security properties of the returned ConnectionSecurityContext object and then call Update.

PublisherSecurity 의 구성원만 속성을 검색할 수는 sysadmin 배포자에서 고정된 서버 역할입니다.The PublisherSecurity property can only be retrieved by members of the sysadmin fixed server role at the Distributor.

반환 된 속성 ConnectionSecurityContext 개체의 멤버에 의해 설정 될 수는 sysadmin 배포자에서 고정된 서버 역할입니다.The properties of the returned ConnectionSecurityContext object can only be set by members of the sysadmin fixed server role at the Distributor.

검색 된 PublisherSecurity 속성은 실행 sp_helpdistpublisher합니다.Retrieving the PublisherSecurity property is equivalent to executing sp_helpdistpublisher.

반환 된 속성을 설정 ConnectionSecurityContext 개체가 실행 같으면 sp_adddistpublisher 또는 sp_changedistpublisher합니다.Setting the properties of the returned ConnectionSecurityContext object is equivalent to executing sp_adddistpublisher or sp_changedistpublisher.

적용 대상