INFORMATICS

The Best

Przełącznik języka

Zaproś mnie na KAWE

Jeżeli podoba Ci się strona i chcesz wspomóc projekt!

Postaw mi kawę na buycoffee.to

This Site

Płatnik

CMS

Hardware

Uncategorised

Emulators

Powershell

Storage Array

DNS

Antivirus program

Licznik

3.png0.png4.png1.png8.png2.png3.png
Today720
Yesterday1207
This week6705
This month16724
Total3041823

Visitor Info

  • IP: 3.149.24.192
  • Browser: Unknown
  • Browser Version:
  • Operating System: Unknown

Who Is Online

2
Online

piątek, 22 listopad 2024 12:47

Skrypt do konwersji SID to USERNAME

Gwiazdka nieaktywnaGwiazdka nieaktywnaGwiazdka nieaktywnaGwiazdka nieaktywnaGwiazdka nieaktywna
 

Skrypt do konwersji SID do username

 

' =======================================
' Author:     Shane Boudreaux
'    Date:         6/20/2001
'    Purpose:    Convert SID to Account Name
' =======================================
' =======================================
' Main Entry Point
' =======================================
On Error Resume Next
 
wscript.echo getSID
' =======================================
' =======================================
' Supporting Functions and Procedures
' =======================================
Private Function getSID()
' Get SID from user
Const POPUP_TITLE = "SID To User Conversion"
SID = InputBox("Enter SID",POPUP_TITLE)
server = "."
Set objWMIService = GetObject("winmgmts:\\" & server & "\root\cimv2")
 
Set objAccount = objWMIService.Get("Win32_SID.SID='" & SID & "'")
strUser = objAccount.AccountName
strDomain = objAccount.ReferencedDomainName
If Err.Number <> 0 Then
getSID = Err.Description
Err.Clear
Else
getSID = "User: " & vbtab & UCase(strUser) & vbcrlf & "Domain: " & vbtab & UCase(strDomain)
End If
End Function
' =======================================

Search