Directory Services |
The DsClientMakeSpnForTargetServer function constructs a service principal name (SPN) that identifies a specific server to use for authentication.
DWORD DsClientMakeSpnForTargetServer( LPCTSTR ServiceClass, LPCTSTR ServiceName, DWORD* pcSpnLength, LPTSTR pszSpn );
Use of an IP address for ServiceName is not recommended because this can create a security vulnerability. Before the SPN is constructed, the IP address must be translated to a computer name through DNS name resolution. It is possible for the DNS name resolution to be spoofed, replacing the intended computer name with an unauthorized computer name.
When using this function, supply the service class and part of a DNS host name.
This funciton is a simplified version of the DsMakeSpn function. The ServiceName is made canonical by resolving through DNS.
GUID-based DNS names are not supported. When constructed, the simplified SPN is as follows:
ServiceClass / ServiceName / ServiceName
The instance name portion (second position) is always set to default. The port and referrer fields are not used.
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension
on Windows NT 4.0 SP6a and Windows 95/98/Me.
Unicode: Implemented as Unicode and ANSI versions on Windows
NT/2000/XP.
Header: Declared in Ntdsapi.h.
Library: Use Ntdsapi.lib.
DsMakeSPN, Domain Controller and Replication Management Functions