Page 1 of 1 1
Topic Options
#136787 - 2005-03-30 07:11 PM Make SidToName() domain aware
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Ruud

Would be very nice feature if you could make the SidToName() function "domain aware", that is to say - be able to prefix the SID with a domain or DC hostname, or maybe a second optional parameter:

?"Name=" SidToName("domain\S-1-5-21-2129867641-1448237841-168566570-242471")

?"Name=" SidToName("\\server\S-1-5-21-2129867641-1448237841-168566570-242471")

I'm aware that the domain is encoded as part of the SID itself, but cross-domain lookups don't seem to work with Kixtart. For example, comparing this feature to the sidtouser exe utility, the syntax is:

sid2user \\server 5 21 1231625022 1405226785 483988704 4652

-Shawn

Top
#136788 - 2005-03-30 07:13 PM Re: Make SidToName() domain aware
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
optional parameter for the server to query, maybe?
_________________________
!

download KiXnet

Top
#136789 - 2005-03-30 07:17 PM Re: Make SidToName() domain aware
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
An optional parameter would be nice, suggested the first way because its more inline with how the other functions (ex, InGroup) work afaik.

-Shawn

Top
#136790 - 2005-03-30 07:18 PM Re: Make SidToName() domain aware
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the problem is that sid already has domain info.
me not keen on voting that weird syntax.
it's like \\domain\domain\user

anyways...
I was thinking, if kixtart could or could be forced to query for other domains avail too.
not only for this function but in general.

say, check the dns for domains and support the found ones?


Edited by Lonkero (2005-03-30 07:20 PM)
_________________________
!

download KiXnet

Top
#136791 - 2005-03-30 07:23 PM Re: Make SidToName() domain aware
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I'm just going with "the flow" son, so for example the InGroup specs:

Quote:


If you want to check for membership in a group on a specific domain or server, use the following format:

"OtherDomain\group"
–or–
"\\SomeServer\group"




Top
#136792 - 2005-03-30 07:32 PM Re: Make SidToName() domain aware
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja, I get you.
I'm just basically against everything today.
one of those days you know.

anyways, group name does not include the domain, right?
but basically sid has the info "domain\group" in it already.
_________________________
!

download KiXnet

Top
#136793 - 2005-04-01 05:49 PM Re: Make SidToName() domain aware
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I agree SidToName is limited because its scope is from the local computer. I have provided augmentation in my DLLs that can perform this type of lookup. I agree with Shawn that we should be ablw to provide an optional server parameter from which the lookup should occur.
Code:
; Method LsaLookupSids($Server, $sids)
; Returns an array of dictionary objects
; One or more text sids can be input into the method. Separate sids with 'white
; space'.
; ComputerName must be NT4 or higher.
$sids = "S-1-5-21-24129212-1035812195-1543859470-1416 S-1-5-21-24129212-1035812195-1543859470-500"
$Info = $Win32Admin.LsaLookupSids ("ambdc005", $sids)
if @error = 0
for each $item in $Info
$keys = $item.keys
? "keys: @error @serror"
for each $key in $keys
$Value = $item.get($key)
? $key + " = " + $Value
next
?
next
else
? "Error: @error @serror"
endif

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#136794 - 2005-05-31 07:38 AM Re: Make SidToName() domain aware
JensKalski Offline
Starting to like KiXtart

Registered: 2000-12-13
Posts: 186
Loc: Germany
Where does Win32Admin came from?
_________________________
Jens Kalski

Top
#136795 - 2005-05-31 02:30 PM Re: Make SidToName() domain aware
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
It is a DLL I provided to the KiX community. http://home.comcast.net/~habullock/kix_solutions.htm
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.078 seconds in which 0.039 seconds were spent on a total of 11 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org