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.png7.png4.png1.png6.png3.png
Today340
Yesterday669
This week6678
This month24676
Total3074163

Visitor Info

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

Who Is Online

4
Online

sobota, 28 grudzień 2024 12:52

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