LG Usage

lg /?

LG V01.03.00cpp Joe Richards (joe@joeware.net) April 2010

 LG Group SecPrin [switches]

   Group         LocalGroup to work with
   Group can be specified in the following ways:
          o domain\localgroup
          o \\server\localgroup
          o localgroup

          If Group is specified as domain\. or \\server\.
          localgroups at that location are enumerated
          If Group is specified as . the localgroups on
          the local machine are enumerated

  SecPrin        Security Principal to add/remove from group

  Switches: (designated by - or /)
   -add          Add SecPrin to Group.
   -remove       Remove SecPrin from Group
   -cleargroup   Remove all members from group
   -addgroup     Add localgroup specified
   -removegroup  Remove localgroup specified
   -sid          Security principal(s) are specified as SIDs
   -sidsout      Output SIDs instead of SecPrin member names
   -r computer   Specify computer to resolve SIDs. [LOCALHOST]
   -comment      Display LG Comments
   -setcomment   Set Comment for addgroup
   -lu           List Users (only used for . enumerate option)

    lg domain\.
      Enumerate localgroups on domain

    lg domain\. -lu
      Enumerate all localgroups and members on domain

    lg \\computer\.
      Enumerate localgroups on computer

    lg . -comment
      Enumerate localgroups and comments on localhost

    lg users
      Enumerates members of localgroup users on localhost

    lg \\computer\bob -addgroup -setcomment "bobs group"
      Create bob localgroup on computer with comment

    lg bob -setcomment "bobs group"
      Sets comment for localgroup bob on localhost

    lg users joe doug louise /add
      Adds joe, doug, and louise to localgroup users

    lg \\comp1\users louise -add -r comp3
      Adds SID resolved at comp3 for louise to localgroup users on comp1

    lg \\comp1\users S-1-5-567-678-89765-456 -sid -add
      Adds specified SID to localgroup users on comp1

    lg \\comp1\users -sidsout
      Lists members of localgroup users on comp1 in SID format

    lg \\comp1 -lu -sidsout
      Lists members of all localgroups on comp1 in SID format

 This software is Freeware. Use it as you wish at your own risk.
 If you have improvement ideas, bugs, or just wish to say Hi, I
 receive email 24x7 and read it in a semi-regular timeframe.
 You can usually find me at joe@joeware.net