def do_SpnCreate(po):
 if (g_createdSCP is None):
  _option_error(po, 'ScpCreate must have been specified before SpnCreate')
 spns = win32security.DsGetSpn(dscon.DS_SPN_SERVICE, _get_option(po, 'service_class'), g_createdSCP.distinguishedName, _get_option(po, 'port', 0), None, None)
 spn = spns[0]
 log(2, 'Created SPN: %s', spn)
 global g_createdSPNLast
 g_createdSPNLast = spn
 g_createdSPNs.append(spn)
 return spn

def do_SpnCreate ( po ) : if ( g_createdSCP is None ) : _option_error ( po , 'ScpCreate must have been specified before SpnCreate' ) spns = win32security . DsGetSpn ( dscon . DS_SPN_SERVICE , _get_option ( po , 'service_class' ) , g_createdSCP . distinguishedName , _get_option ( po , 'port' , 0 ) , None , None ) spn = spns [ 0 ] log ( 2 , 'Created SPN: %s' , spn ) global g_createdSPNLast g_createdSPNLast = spn g_createdSPNs . append ( spn ) return spn
create a service principal name .