Announcement

Collapse
No announcement yet.

Net use Question

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Net use Question

    Hi Guys,

    When i want to load automatic batch file for net use some drive - share, because i have diffrent domains, i usually put a batch file on startup with the NET USE command and add a user/password, can i avoid sharing this password and use some other method or encrypt the password?

    Example of the current file:

    NET USE Y: \\SERVERNAME\SHARE PASSWORD /USEROMAIN\USERNAME

    Thanks,
    Retaliator.
    Thanks & Regards

    Retaliator

    MCSA/MCSE/CCNA
    Computer Science Graduate

  • #2
    Re: Net use Question

    Originally posted by Retaliator View Post
    NET USE Y: \\SERVERNAME\SHARE PASSWORD /USEROMAIN\USERNAME
    That is a very happy user . Use [code] ... [/code] for code;
    Code:
    NET USE Y: \\SERVERNAME\SHARE PASSWORD /USER:DOMAIN\USERNAME
    When you use a login Policy (GPO) to link the script, there you have the option to use 'scriptparameters'.
    Add the credentials as the script parameters:
    DOMAIN\USERNAME PASSWORD
    Then the script it self will be like this:
    Code:
    NET USE Y: \\SERVERNAME\SHARE %2 /USER:%1
    For %1 it reads the first parameter and for %2 it reads the second parameter.

    \Rem
    Last edited by Rems; 20th March 2007, 11:23.

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: Net use Question

      And i do not use that via GPO?
      Thanks & Regards

      Retaliator

      MCSA/MCSE/CCNA
      Computer Science Graduate

      Comment


      • #4
        Re: Net use Question

        Originally posted by Retaliator View Post
        And i do not use that via GPO?
        No, you do have to run it via GPO.
        In the GPO you have the bar to add 'parameters' for the script (or for the batch).

        In the GPO users configuration --> logon script:
        scriptname: \\path\batch.cmd
        scriptparameters: DOMAIN\USERNAME PASSWORD
        (parameters must be separated with one space)

        store the batch (batch.cmd) in a share (\\path\) on the server.

        batch.cmd :
        Code:
        NET USE Y: \\SERVERNAME\SHARE %2 /USER:%1
        Now when the batch is launched by this GPO it will automaticly fill in for %1 the first parameter and for %2 it reads the second parameter.

        This way the credentials needed for the batch are now stored in the GPObject, and are no longer visible in the batch-file.

        \Rem
        Last edited by Rems; 20th March 2007, 15:06.

        This posting is provided "AS IS" with no warranties, and confers no rights.

        __________________

        ** Remember to give credit where credit's due **
        and leave Reputation Points for meaningful posts

        Comment


        • #5
          Re: Net use Question

          Thanks, i wanted something like that but not via GPO
          Thanks & Regards

          Retaliator

          MCSA/MCSE/CCNA
          Computer Science Graduate

          Comment


          • #6
            Re: Net use Question

            Originally posted by Retaliator View Post
            Thanks, i wanted something like that but not via GPO
            In that case, take a look at here;
            http://forums.petri.com/showthread.p...3620#post63620
            (end of page 1 and on page 2)

            \Rem

            This posting is provided "AS IS" with no warranties, and confers no rights.

            __________________

            ** Remember to give credit where credit's due **
            and leave Reputation Points for meaningful posts

            Comment


            • #7
              Re: Net use Question

              Thanks
              Retaliator
              Thanks & Regards

              Retaliator

              MCSA/MCSE/CCNA
              Computer Science Graduate

              Comment

              Working...
              X