Login script based on group membership

Discussion in 'Scripting' started by Dustin Nitschke, Jul 18, 2005.

  1. Is there a way to write a login script based on group membership?

    For example if User SAM is in ACCOUNTING then the ACCOUNTING.BAT executes
    and if he's also in QUICKBOOKS then QUICKBOOKS.BAT executes as well?

    Dustin
     
    Dustin Nitschke, Jul 18, 2005
    #1
    1. Advertisements

  2. From: "Dustin Nitschke" <>

    | Is there a way to write a login script based on group membership?
    |
    | For example if User SAM is in ACCOUNTING then the ACCOUNTING.BAT executes
    | and if he's also in QUICKBOOKS then QUICKBOOKS.BAT executes as well?
    |
    | Dustin

    Why not just put all the common scripting in the main script and thoase differences in other
    scripts then use INCLUDE or other statement to call the variations and get away from using
    simple BAT batch files. BAT file logon scripting is just too limiting. Albeit, it can be
    done in a series of IF statements and using the Resource Kit utility; IFMEMBER.EXE .

    The following is a Kixtart example ( http://kixtart.org Kixtart is CareWare )...

    SELECT
    CASE ingroup("quickbooks")
    ; member of quickbooks
    include "quickbookscript"
    CASE ingroup("accounting")
    ; member of accounting
    include "accountingscript"
    CASE 1
    ; remaining groups
    include "othergroupsscript"
    ENDSELECT
     
    David H. Lipman, Jul 19, 2005
    #2
    1. Advertisements

  3. David:

    I'm not a scripting expert or programmer by any means. Do you have a good
    site to visit to use IF/Else/Then statements? Or can you give me an example
    using those statements? I do appreciate your help.

    Dustin
     
    Dustin Nitschke, Jul 19, 2005
    #3
  4. Hi,

    I have never seen a method to check group membership in a batch file unless
    a third party tool is used. If it helps, I have some example VBScript logon
    scripts linked on this page:

    http://www.rlmueller.net/freecode2.htm

    Most of the examples map drives according to group membership. The method
    you select depends on the client OS's your logon scripts will support, if
    you have nested groups, if you need to check membership in the "primary"
    group, and how many group checks you need.
     
    Richard Mueller [MVP], Jul 19, 2005
    #4
  5. Howdy Dustin!

    Did you try ifmember.exe from the Windows Server ResourceKit? You can
    use it with your batchfile.

    http://www.microsoft.com/downloads/...69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

    cheers,

    Florian
     
    Florian Frommherz, Jul 19, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.