Questions tagged [sid]

In the context of the Microsoft Windows NT line of operating systems, a SID (Security IDentifier) is a unique, immutable identifier of a user, user group, or other security principal.

Windows grants or denies access and privileges to resources based on access control lists (ACLs), which use SIDs to uniquely identify users and their group memberships.

When a user logs into a computer, an access token is generated that contains user and group SIDs and user privilege level. When a user requests access to a resource, the access token is checked against the ACL to permit or deny particular action on a particular object.

SIDs are useful for troubleshooting issues with security audits, Windows server and domain migrations.

221 questions
3
votes
2 answers

Convert SID to Username in C#

In .net, I can create a NTAccount using domain and username, and get it's SID. But I cannot convert the SID back to NTAccount using translate function. new SecurityIdentifier(stringSid).Translate(typeof(NTAccount)).ToString(); And this two way…
user970444
  • 35
  • 2
  • 5
3
votes
6 answers

How to convert the SID to String and vice versa in Java?

I'm writing a program in Java, using Spring-LDAP. I need to implement a method, which should search a user by SID. For this reason I use a filter like "&((objectClass=User)(objectSid="+sid+"))". The search doesn't work with sid in String format like…
mtm
  • 125
  • 2
  • 2
  • 6
3
votes
2 answers

Update SID in SQL Server

My user was deleted from the Active Directory and recreated. When running the select suser_sid, I notice that it shows the old SID. Is there a way to update it to my new SID? I am DBA Admin on SQL Server
Rick
  • 2,288
  • 18
  • 66
  • 98
3
votes
0 answers

Get AdministratorsMembers SIDs in .NET CORE 2

I wrote this function to retrieve all Administrators Members SIDs: private IList GetAdministratorsMembersSIDs() { IList adminMembers = new List(); SecurityIdentifier id = new SecurityIdentifier(administratorsSid); …
Marco Ferrari
  • 43
  • 1
  • 5
3
votes
1 answer

Editing registry value for newly created user

I have a .NET application that creates a new local user like so: var principalContext = new PrincipalContext(ContextType.Machine); var userPrincipal = new UserPrincipal(principalContext); userPrincipal.Name =…
Bas
  • 1,946
  • 21
  • 38
3
votes
2 answers

Can I create a Windows mutex globally for those processes which know the password of the mutex?

I want to create a Windows mutex by using WinAPI, CreateMutex() and OpenMutex(). But for security concern, I want the mutex be opened by those processes who know the "password" or the hard-code magic code. I don't want the mutex be accessed by every…
Calvin Wu
  • 142
  • 10
3
votes
3 answers

Adding members to local groups by SID in multiple languages

I'm new to powershell/scripting/life in general, but finally I got a problem that is worthy of asking for help: I've various Windows localizations in environment - English, Finnish and Russian in current environment, but with possibilities to have…
Kārlis Bergmanis
  • 131
  • 2
  • 3
  • 7
3
votes
4 answers

Running Powershell command in a command line/batch file

I am creating a batch file which involves converting a SID to local/domain username. Since we can not achieve this using the command prompt I am planning to use powershell and I have the PS command as well. I am able to run it in powershell console…
gbabu
  • 1,088
  • 11
  • 15
3
votes
1 answer

Obtain logged on user SID rather than elevated user

How would I obtain the logged on user SID in an elevated .NET application? I have tried WindowsIdentity.GetCurrent() which of course returns the administrator that elevated the process. From what I can see I may need to use native methods to do…
Luke
  • 291
  • 2
  • 8
3
votes
1 answer

Get local Windows user name from a SID with C++

If I have a list of Windows account SIDs (strings like "S-1-5-21-16217043-3088031003-1644254475-1001") how can I get the name of Windows user accounts from them (stuff like "John Doe") using C++ and WinAPIs?
ahmd0
  • 16,633
  • 33
  • 137
  • 233
3
votes
2 answers

Converting a binary type SID to System.Security.Principal.SecurityIdentifier in PowerShell

I found a link on this website which shows how to convert a SID to the binary type. Can someone please tell me how to do the reverse - to convert a binary type back to a SID. This is the script that was provided to go from SID to binary: PS> $sid =…
David
  • 31
  • 1
  • 1
  • 2
3
votes
1 answer

how to get PSID from TOKEN_INFORMATION_CLASS?

I try to use information from this post: https://stackoverflow.com/a/251267/393087 And the code I came up with is: HANDLE hToken; OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES, &hToken); DWORD dwSize; TOKEN_INFORMATION_CLASS…
rsk82
  • 28,217
  • 50
  • 150
  • 240
2
votes
2 answers

Determine if SID is User or Group

Is it possible to determine if a given SID is User or Group using .NET? I have a list of SIDs which I need to edit in a listview, so for User and Group I want to use different icons
javros
  • 825
  • 10
  • 31
2
votes
1 answer

C# - Implementing Single Sign On in WinForms (as Outlook does)

I have created a server/client application. Both of them are written in C#. It uses TCP/IP communication with custom SSL implementation. Currently the login procedure requires a username/password pair for logging in. I was asked to implement the…
user927432
  • 99
  • 1
  • 6
2
votes
1 answer

Oracle 18c XE: Connecting to a PDB using SID (for legacy application)

I just installed the Oracle 18c XE Dadtabase and created a PDB (XEPDB1) inside the CDB. I then created a new schema inside the PDF and I can connect to that schema successfully using the Service Name (SQL Developer). But my legacy application…
Michael F
  • 23
  • 1
  • 5
1 2
3
14 15