locked
Logon Scripts RRS feed

  • Question

  • Hi All,

    Is there any problem with the following snipet from a script, it's very similar to the other mappinga, see below

    If InStr(strGroup, "CN=DIRECTORS") then

        wshNetwork.MapNetworkDrive "j:","\\servername\Directors"  

    END If

    If i combine the mapping line in with another group of mappings all is ok.

    If InStr(strGroups, "CN=ACCOUNTS") Then

        wshNetwork.MapNetworkDrive "p:","\\servername\accounts"
        wshNetwork.MapNetworkDrive "t:","\\servername\accountsdb"
        wshNetwork.MapNetworkDrive "q:","\\servername\quickbooks2012"  
        wshNetwork.MapNetworkDrive "j:","\\servername\Directors"

    END If

    The Directors group looks the same properties as the rest, but cant see why it would't map, on the first example.

    Many Thanks

    Richard

    • Moved by Bill_Stewart Friday, October 24, 2014 3:12 PM Unanswerable drive-by question
    Monday, July 21, 2014 3:57 PM

Answers

  • No S on the end of group, see below.

    If InStr(strGroup, "CN=DIRECTORS") then

    Many thanks to all that helped


    Richard Tarlton

    • Marked as answer by RichardT1973 Friday, March 13, 2015 5:24 PM
    Friday, March 13, 2015 5:24 PM

All replies

  • Sorry but there is not enough information to know what you issue is.

    You can try this:

    If InStr(  ToUpper(strGroup),   "CN=DIRECTORS"  ) then


    ¯\_(ツ)_/¯

    Monday, July 21, 2014 5:00 PM
  • In your code example, the first example uses the variable "strGroup", but the second example uses "strGroups". Is that a typo in your code, or just in this example? If the typo is in your code, it's probably why your first section of code doesn't map the drive.

    Regards, Matthew
    MCPD | MCITP
    My Blog
    View Matthew Yarlett's LinkedIn profileView Matthew Yarlett's profile

    See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here: Upload and Crop User Profile Photos

    • Proposed as answer by jrv Friday, March 13, 2015 10:02 PM
    Monday, July 21, 2014 11:07 PM
  • If you are currently deploying script via GPO, may I suggest using GPO preferences with item-level targeting?

    Alternatively change to If InStr(UCase(strGroup), "CN=DIRECTORS") then

    Add an Option Explicit because strGroup might be typo

    Thursday, July 24, 2014 9:11 PM
  • No S on the end of group, see below.

    If InStr(strGroup, "CN=DIRECTORS") then

    Many thanks to all that helped


    Richard Tarlton

    • Marked as answer by RichardT1973 Friday, March 13, 2015 5:24 PM
    Friday, March 13, 2015 5:24 PM