大网数据广告活动
域与目录服务

How a Service Composes its SPNs

· 52CE 我爱测

A service can use two functions to compose its SPNs DsGetSpn is a general-purpose function for composing SPNs and DsServerRegisterSpn is a specialized function for composing and registering simple SPNs for a host-based service.

A service can use two functions to compose its SPNs: DsGetSpn is a general-purpose function for composing SPNs and DsServerRegisterSpn is a specialized function for composing and registering simple SPNs for a host-based service.

A service installer typically uses the DsGetSpn function to compose SPNs, which it then registers on the service's logon account using the DsWriteAccountSpn function. The DsGetSpn can perform the following functions.

  • Create a simple SPN with the "<service class>/<host>" format for a host-based service.
  • Create a complex SPN that includes the "<service name>" component used by replicable services or the "<port>" component that distinguishes multiple instances of a service on a single host.
  • Create a single SPN with the "<host>" component set to either the name of a specified host or the name of the local computer by default.
  • Create an array of SPNs for multiple service instances that will run on multiple hosts throughout the forest. Each SPN specifies the name of the host for a service instance.
  • Create an array of SPNs for multiple service instances that will run on the same host. Each SPN specifies the name of the host and a port number for a service instance.

The array of names returned by DsGetSpn must be freed by calling the DsFreeSpnArray function.

Be aware that the DsGetSpn, DsWriteAccountSpn, and DsServerRegisterSpn functions do not verify that SPNs are unique. Because mutual authentication fails if a client presents an SPN that is not unique, verify uniqueness before registering an SPN. To do this, search the global catalog (GC) for servicePrincipalName attributes that match your SPN. For more information about searching the GC, see Searching the Global Catalog.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。