Announcement

Collapse
No announcement yet.

Assigning Static IP to a User

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

  • Assigning Static IP to a User

    Hi guys is there a way to assign a static ip address when a user logs on.

    For example User1 logs on..and automatically he will acquire an ip specific for him and when he logs off the ip will be removed. and User2 will log in to the same computer and he will also acquire a static ip add assigned to him.is this possible.. Thanks guys..
    Ronuel
    MCP
    There is only one way to find Out..Its to try it and/or Do it...

  • #2
    Re: Assigning Static IP to a User

    You can only assign IPs in DHCP to individual devices, not to users. You would need to use a script to do this based on a database of some kind; but the database would have to be central and the computer would have to get itself an "interim" IP address until the script changed it. Don't forget that the IP addresses you assign to users would need to be "Excluded" from your DHCP scope.

    What is the purpose behind this idea?


    Tom
    For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

    Anything you say will be misquoted and used against you

    Comment


    • #3
      Re: Assigning Static IP to a User

      You could do this using the "netsh" command. Create 2 scripts, and assign one script to each user for each IP address you want to use.
      MCITP:SA, MCSA 2003, MCP, CCNA, A+, Net+, Security+

      Comment


      • #4
        Re: Assigning Static IP to a User

        Boondock's right, so here's a bit more to help too:

        To export the settings of a current configuration:

        Code:
        netsh -c interface dump > c:\user1.txt
        To import thse settings:

        Code:
        netsh -f c:\user1.txt
        So you can setup User1's PC just as you like, then export to a file called user1.txt. Then setup that machine as if for user 2 and export to a file called user2.txt

        As each user logs on, your batch file will import the correct file for that particular user.

        Once you have it working for a couple of users, experiment with trying to use %username% in the script, rather than hard code a whole bunch of user names.
        Best wishes,
        PaulH.
        MCP:Server 2003; MCITP:Server 2008; MCTS: SBS2008

        Comment


        • #5
          Re: Assigning Static IP to a User

          Also test if a regular user have the permissions.
          Because I don't think so...
          Marcel
          Technical Consultant
          Netherlands
          http://www.phetios.com
          http://blog.nessus.nl

          MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
          "No matter how secure, there is always the human factor."

          "Enjoy life today, tomorrow may never come."
          "If you're going through hell, keep going. ~Winston Churchill"

          Comment


          • #6
            Re: Assigning Static IP to a User

            Yes, he'll have to be a member of the local administrators group on the PC, unless you want to have the batch file run a nifty bit of "sanur" to elevate that particular batch file.

            Also look at this brilliant article: http://www.petri.com/configure_tcp_ip_from_cmd.htm from your favourite forum

            Still curious as to why you want to do this...
            Best wishes,
            PaulH.
            MCP:Server 2003; MCITP:Server 2008; MCTS: SBS2008

            Comment


            • #7
              Re: Assigning Static IP to a User

              I know netsh (used it many times) and I'm aware of sanur
              also I'm aware of that users don't have permissions to change the network configuration...
              So it wasn't actually a question but more a remark

              However, I don't know what permissions the users have on his environment....
              Marcel
              Technical Consultant
              Netherlands
              http://www.phetios.com
              http://blog.nessus.nl

              MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
              "No matter how secure, there is always the human factor."

              "Enjoy life today, tomorrow may never come."
              "If you're going through hell, keep going. ~Winston Churchill"

              Comment


              • #8
                Re: Assigning Static IP to a User

                Good morning Marcel,

                Yes, your remark was a very well placed one and I wanted to expand on the issue to assist the OP. Many thanks for your valued input.
                Best wishes,
                PaulH.
                MCP:Server 2003; MCITP:Server 2008; MCTS: SBS2008

                Comment


                • #9
                  Re: Assigning Static IP to a User

                  Originally posted by PaulH View Post
                  Yes, he'll have to be a member of the local administrators group on the PC
                  No, there is no need to make all these users local administrators, just! member of the local group Network Configuration Operators is sufficient for them to change IP addresses with netsh.exe.

                  You can add the 'domain users' group to this local group, or create a special group in active directory for only those users. Then use a computer startupscript OR 'Restricted Groups GPO' to nest the domain group into the local group.

                  \Rems

                  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


                  • #10
                    Re: Assigning Static IP to a User

                    Thanks for all the reply sirs.. So it is possible... Well to tell you why i want to do this is because of my boss is planning to use a single machine with two users. one is for users who will take exams and the other is for users for workshop. Now users who will take exam needs internet so when exam users logs in locally they will acquire an IP that has an internet connection while workshop users must not have internet connection when they log in. and also these users should also be limited users..this i dont think is not possible because of permissions. Is there a step by step in doing this? and the netsh command? i really appreciate your replies.. Thanks so much
                    Ronuel
                    MCP
                    There is only one way to find Out..Its to try it and/or Do it...

                    Comment


                    • #11
                      Re: Assigning Static IP to a User

                      It sounds like you would be better served by a firewall solution with authentication which would determine rights to access networks based on user ID.


                      Tom
                      For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

                      Anything you say will be misquoted and used against you

                      Comment


                      • #12
                        Re: Assigning Static IP to a User

                        Rems is absolutely right to remind us of that security group which is better (because it is more restricted) than the Local Administrators group.

                        To keep things a lot simpler, can you just enable Parental/Content Control on the web and have the exams user denied access to any websites. Go to Internet Options, Content and enable this - you can then deny all websites by denying www.

                        Actually, I just did an experiment and you can deny all sites by denying just dot (.) which also denies ftp sites etc.

                        Sure, it's not totally foolproof and someone taking their exams may bring in a memory stick with Opera on it to install, but often a simple "good enough" solution is easier to manage and maintain.

                        Try it and let us know how you get on.
                        Best wishes,
                        PaulH.
                        MCP:Server 2003; MCITP:Server 2008; MCTS: SBS2008

                        Comment


                        • #13
                          Re: Assigning Static IP to a User

                          I did something similar one time. I used a group policy and applied to users. I created an OU called No Internet. Then applied a group policy to that OU in which it would give a false proxy, I used 1.1.1.1 as my proxy server address under the LAN settings.

                          If they were in the OU of No Internet....they didn't have internet.
                          MCITP:SA, MCSA 2003, MCP, CCNA, A+, Net+, Security+

                          Comment


                          • #14
                            Re: Assigning Static IP to a User

                            We use ISA Server 2004 to block members of a certain group in Active Directory to browse the internet.

                            \Rems

                            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


                            • #15
                              Re: Assigning Static IP to a User

                              A firewall/Proxy server with authentication is the way to go and ISA is just an example for this.
                              Marcel
                              Technical Consultant
                              Netherlands
                              http://www.phetios.com
                              http://blog.nessus.nl

                              MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
                              "No matter how secure, there is always the human factor."

                              "Enjoy life today, tomorrow may never come."
                              "If you're going through hell, keep going. ~Winston Churchill"

                              Comment

                              Working...
                              X