1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Logon Scripts

Discussion in 'Windows Server System' started by webman1979, 2005/03/24.

Thread Status:
Not open for further replies.
  1. 2005/03/24
    webman1979

    webman1979 Inactive Thread Starter

    Joined:
    2005/03/24
    Messages:
    15
    Likes Received:
    0
    I need to find a way to check what operating system a computer is running and the user that is logged up, to determin what drives need to be mapped. The server is Win 2k server, and client computers range from Win 95 to Win XP. Thank you
     
    Last edited: 2005/03/24
  2. 2005/03/24
    Newt

    Newt Inactive

    Joined:
    2002/01/07
    Messages:
    10,974
    Likes Received:
    2
    Probably much more elegant ways to do this but how about a batch file? Something using the VER command would do it so:

    Ver | Find "XP" > Nul
    If not ErrorLevel 1 Goto XPScript
    Ver | Find "2000" > Nul
    If not ErrorLevel 1 Goto 2KScript
    Goto Error

    :XPScript
    "\\domaincontroller\netlogon\setupxp.vbs"

    :2KScript
    "\\domaincontroller\netlogon\setup2K.vbs"

    :Error
    "\\domaincontroller\netlogon\somethingbroke.vbs "

    Then a .vbs script like one of these (taken from This MSDN article)

    [VBScript]
    Dim WshNetwork
    Set WshNetwork = WScript.CreateObject( "WScript.Network ")
    WshNetwork.MapNetworkDrive "E: ", "\\Server\Public "

    [JScript]
    var WshNetwork = WScript.CreateObject( "WScript.Network ");
    WshNetwork.MapNetworkDrive ( "E: ", "\\\\Server\\Public ");
     
    Newt,
    #2

  3. to hide this advert.

  4. 2005/03/29
    Newt

    Newt Inactive

    Joined:
    2002/01/07
    Messages:
    10,974
    Likes Received:
    2
    webman1979 - how goes the scripts problem?

    Did the above stuff help or did you find another way to do what was needed?
     
    Newt,
    #3
  5. 2005/03/31
    webman1979

    webman1979 Inactive Thread Starter

    Joined:
    2005/03/24
    Messages:
    15
    Likes Received:
    0
    Yes is help very much...thank you
     
  6. 2005/06/17
    webman1979

    webman1979 Inactive Thread Starter

    Joined:
    2005/03/24
    Messages:
    15
    Likes Received:
    0
    I desided i needed to return to this post again. Now i need to come up with a script that will map drives depending upon what user logs. Most users will have 3 to 5 drives that need to be mapped. Any subjestions anyone?
     
  7. 2005/06/23
    ReggieB

    ReggieB Inactive Alumni

    Joined:
    2004/05/12
    Messages:
    2,786
    Likes Received:
    2
    Personally I'd group the users in Active Directory (AD) Organisational Units (OU), and then apply seperate logon scripts to each OU via the OU's group policy. That way if a user moves from one group to another (and therefore needs different drives mapped) all you need to do is move the user object from one OU to the appropriate one for the new group. Also ceating a new user in the appropriate OU will automatically give them the appropriate logon script.
     
  8. 2005/06/23
    Scott Smith

    Scott Smith Inactive Alumni

    Joined:
    2002/01/12
    Messages:
    1,950
    Likes Received:
    4
    I'm not sure I'm clear on the question.

    If you are asking how the bat file should look this would be a start.




    @ECHO OFF


    NET USE W: /DELETE
    NET USE W: \\controller\Whitfield

    NET USE T: /DELETE
    NET USE T: \\controller\timekeeper

    NET USE P: /DELETE
    NET USE P: \\controller\HR
     
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.