Mapped drive and group policy scripting issue

Discussion in 'Networks' started by Jiser, Jan 10, 2008.

  1. Jiser

    Jiser Kilobyte Poster

    385
    10
    37
    Hi all. This is on server 2003 + xp workstations. Have a problem first that once a disconnected drive is disconnected it reappears on relogin.

    When I map a drive it dissapears on relogin.

    The weird thing is I edited the login script to include mapping a drive with a letter not allready mapped and it doesn't work : / In fact the whole script does not work.
     
    Certifications: BSc (Hons), PGc, MCTS:Win 7, MCSA W7/MCITP EDST, ITIL Foundation, Prince 2 Foundation, C&G: Web Design, MOS 07: Excel, Word, Powerpoint, Outlook.
  2. Sparky
    Highly Decorated Member Award 500 Likes Award

    Sparky Zettabyte Poster Moderator

    10,718
    543
    364
    can you post the script here mate?
     
    Certifications: MSc MCSE MCSA:M MCSA:S MCITP:EA MCTS(x5) MS-900 AZ-900 Security+ Network+ A+
    WIP: Microsoft Certs
  3. Jiser

    Jiser Kilobyte Poster

    385
    10
    37
    Option Explicit
    Dim objNetwork
    Dim strDriveLetter, strRemotePath

    strDriveLetter = "Z:"
    strRemotePath = "\\server\rmmaths"

    ' Purpose of the script to create a network object. (objNetwork)
    ' Then to apply the MapNetworkDrive method. Result z: drive
    Set objNetwork = CreateObject("WScript.Network")
    objNetwork.MapNetworkDrive strDriveLetter, strRemotePath

    WScript.Quit

    ' End of Logon Script.
     
    Certifications: BSc (Hons), PGc, MCTS:Win 7, MCSA W7/MCITP EDST, ITIL Foundation, Prince 2 Foundation, C&G: Web Design, MOS 07: Excel, Word, Powerpoint, Outlook.
  4. Sparky
    Highly Decorated Member Award 500 Likes Award

    Sparky Zettabyte Poster Moderator

    10,718
    543
    364
    how about...

    net use Z: \\server\rmmaths

    ...and save as a batch file?
     
    Certifications: MSc MCSE MCSA:M MCSA:S MCITP:EA MCTS(x5) MS-900 AZ-900 Security+ Network+ A+
    WIP: Microsoft Certs
  5. Kitkatninja
    Highly Decorated Member Award 500 Likes Award

    Kitkatninja aka me, myself & I Moderator

    11,140
    555
    383
    Ok unless I'm reading it wrong, you've stated that the drives reappears or disappears on logon???

    I've tested the script on my own servers and it works (I did change the server name and the share name to one that was on my network).

    Are you sure that there is a server named "server" on your network with a share called "rmmaths"? Also make sure that user or user group actually has permissions (share as well as ntfs) to access that share on the server, otherwise the script with not map the drive.

    Another thing to check is if there is a policy in AD that is restricting that drive letter. Or that there is another script removing the drive.

    -Ken
     
    Certifications: MSc, PGDip, PGCert, BSc, HNC, LCGI, MBCS CITP, MCP, MCSA, MCSE, MCE, A+, N+, S+, Server+
    WIP: MSc Cyber Security
  6. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    172
    211
    The script looks good, and I will take Kens word that it functions (im being lazy right now, and not in a position to test it). Have you attempted to run this on your machine? try using cscript to run the script file, see what happens. If it works fine, then its not a permissions issue, etc, if it doesnt, i would suspect that.

    You arent using a kix script that is deleting the drive mapping after this portion of the script is running are you? I also assume that the drive in question is not mapped already.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  7. C4sper

    C4sper Byte Poster

    217
    0
    38
    I'm sure you did it already but just to be sure check

    \\domain_contr\netlogon for any *.bat files :)
    they may be assigned to users (check in user properties in AD)

    looks like one script overrides the other one
     
    Certifications: ECDL, A+, MCP, MCDST
    WIP: MCSE, CCNA
  8. Jiser

    Jiser Kilobyte Poster

    385
    10
    37
    Thanks all I will check all these on Monday at work : )

    Ill let you know how I get on.

    CHeers
     
    Certifications: BSc (Hons), PGc, MCTS:Win 7, MCSA W7/MCITP EDST, ITIL Foundation, Prince 2 Foundation, C&G: Web Design, MOS 07: Excel, Word, Powerpoint, Outlook.
  9. Jiser

    Jiser Kilobyte Poster

    385
    10
    37
    Sorted the problem. Took alot of playing about but this is my 2nd I.T. job and I am all alone having never done group policy, logon scripts etc. Aww, but I am having to learn quick which is great, I tam taking alot in. I have now re done the whole group policy/security settings for the two schools I support. Gradually sorting through the users converting them to the Proper way! Problem is alot of these people never like change.

    Cheers for all your help.
     
    Certifications: BSc (Hons), PGc, MCTS:Win 7, MCSA W7/MCITP EDST, ITIL Foundation, Prince 2 Foundation, C&G: Web Design, MOS 07: Excel, Word, Powerpoint, Outlook.

Share This Page

Loading...
  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.