"Brauer, Jan" <[EMAIL PROTECTED]> writes:

> Hi,
> 
> I wrote some code to get the administrators group name for the
> registry by looking up the name for the SID. We could use it for
> $ENV('ADMINGROUP') = get_admin_group() to modify the net localgroup
> add part in the install.pl.

OK, I have modified todo.pl to set an "Administrators" environment
variable.  (Or should we stick to upper-case?)

I used code like this:

    use Win32::OLE;
    my $wmi = Win32::OLE->GetObject ('WinMgmts:');
    my $admin_sid = $wmi->Get ('Win32_SID.SID="S-1-5-32-544"');
    return $admin_sid->{'AccountName'};

Mostly because I find it easier to read, and we are already using WMI
in todo.pl.

I am having trouble checking it in right now, though, because the
SourceForge CVS server seems to be hosed.

 - Pat


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
unattended-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unattended-devel

Reply via email to