Les Snippets

Connexion

Obtient le nom d'un compte à partir de son SID

Niveau requis pour utiliser/comprendre cette source : 1 ( Débutant )
Créé le 29/09/2009 13:52:25 et initié par Willi [Liste]
Vue : 1219
Catégorie(s) : Sécurité
Langages dispo pour ce code :
- C# 2.x, C# 3.x
- VB 2005, VB 2008
- Voir tous les langages pour ce code snippet



Langage : VB 2005 , VB 2008
Date ajout : 12/10/2009
Posté par Willi [Liste]
Public Shared Function GetAccountNameFromSid(ByVal data As Byte()) As String

  Dim si As New SecurityIdentifier(data, 0)
  Dim szAccountName As String = si.Translate(GetType(NTAccount)).Value
  Return szAccountName 
End Function


Snippets en rapport avec : Account, Name sid