strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
'Set colAccounts = objWMIService.ExecQuery ("Select * From Win32_UserAccount Where LocalAccount = TRUE")
Set colAccounts = objWMIService.ExecQuery ("Select * From Win32_UserAccount")
For Each objAccount in colAccounts
Wscript.Echo objAccount.Name & VbTab & objAccount.SID
Next
Lien vers le fichier : cliquez ici
Si vous voulez le sid d'un compte en particulier
varLoginAccount = InputBox("Entrez le login rechercher","Login","yourlogin")
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
'Set colAccounts = objWMIService.ExecQuery ("Select * From Win32_UserAccount Where LocalAccount = TRUE")
Set colAccounts = objWMIService.ExecQuery ("Select * From Win32_UserAccount")
For Each objAccount in colAccounts
If objAccount.Name = Lcase(varLoginAccount) Then Wscript.Echo objAccount.Name & VbTab & objAccount.SID
'Wscript.Echo objAccount.Name & VbTab & objAccount.SID
Next
Lien vers le fichier : cliquez ici
Article(s) en relation(s)