delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/05/09/18:24:02

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Gerald S. Williams" <gsw AT agere DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: Finding your SID (was Re: problem starting inetd as NT service)
Date: Thu, 9 May 2002 18:23:04 -0400
Message-ID: <GBEGLOMMCLDACBPKDIHFIEDDCIAA.gsw@agere.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
In-Reply-To: <20020509151548.GI1236@tishler.net>

Problem solved.

I thought that I was able to contact the domain controller,
since I was able to change my domain password successfully
and do other sorts of things that required me to login.
However, apparently this was something other than the PDC
or BDC. Or at least I was in a situation where I wasn't
"trusted" enough to contact them via mkpasswd. Thinking it
was the latter, I even tried hacking mkpasswd to use the
appropriate Active Directory calls, to no avail.

But today, after finding someone that could use mkpasswd,
I simply copied his WINS settings and now it works for
me, too. Doh!

Thanks for the help,

-Jerry Williams

P.S. I don't know if anyone's interested in this, but here's
my previous Python script updated to provide more correct
results:
-----
#!/usr/bin/echo THIS_IS_ONLY_FOR_WINDOWS_PYTHON

from _winreg import *
from os import environ

class User:
    def __init__(self,masterkey,sid):
        self.sid = sid
        userkey = OpenKey(masterkey,sid)
        self.data = {}
        for valueno in range(QueryInfoKey(userkey)[1]):
            (name,data,type) = EnumValue(userkey,valueno)
            self.data[name] = data
        userkey.Close()
        profilePath = self.data['ProfileImagePath'].split("%")
        for i in range(1,len(profilePath),2):
            profilePath[i] = environ[profilePath[i]]
        self.profilePath = "".join(profilePath)

users = []

masterkey = OpenKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList")
for userno in range(QueryInfoKey(masterkey)[0]):
    users.append(User(masterkey,EnumKey(masterkey,userno)))
masterkey.Close()

profilePath = environ["USERPROFILE"]
userName = environ["USERNAME"]
userDomain = environ["USERDOMAIN"]

# Offset of 10000 is for domain users. Use 0 for local users.
offset = 10000

for user in users:
    if user.profilePath == profilePath:
        # Group 513/10513 is for all users.
        # This assumes you want your home directory in /home/userName
        print ":".join([userName, \
                        "unused_by_nt/2000/xp", \
                        str(int(user.sid.split("-")[-1])+offset),
                        str(513+offset), \
                        "U-" + userDomain + "\\" + userName + "," + user.sid, \
                        "/home/" + userName, \
                        "/bin/bash"])


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019