All;
I'm not a developer by any means, but I've been given a task at work that requires some PowerShell expertise -- can anyone help? I'm sure I can do this in one operation, but don't know how.
I need to resolve a huge number of SIDs into their equivalent "Friendly Names" so I know who they are. We use 'employee-ID' numbers as the actual account login, so resolving SIDs to account-names won't do much. Let's say my domain is "DOVER". I can produce the following: "DOVER\E123456" for employee "George Jones", but I need something that spits out, "Jones, George" for me.
The folllowing line yields, "DOVER\E123456" via PowerShell
([System.Security.Principal.SecurityIdentifier]("PUT-SID-HERE")).Translate([System.Security.Principal.NTAccount])
Can anyone adjust this line, so that it spits out, "Jones, George" for me? I'd like everything on one non-wrapped line, because I'm going to take that line, and read a SID into it from another file, so I'll have fifty 1-line queries each with its own SID...
↧