• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Add IP Address changer - Snap-in scripts included

Scheduled Pinned Locked Moved
Feature Request
2
6
3.3k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    Tribble
    last edited by Oct 15, 2013, 5:30 PM

    Hi guys, My feature request is already 50% done!

    I’ve hashed out the following script/s that can change the IP address on freshly imaged clients from data contained in a .csv file.

    I was hoping you could update the “IP ADDRESS” field on the Host info list to work with it by updating\modifying the csv file. Feel free to hijack the scripts for full Integration if you like.

    Attached are both .bat and .vbs versions of the script to run on the client pc, [B]the Batch script is a lot cleaner and simpler to use[/B].
    You will need to modify the Path information in either script to point at the .CSV file.
    The path is indicated as \server\share\folder

    The .vbs script requires you to run the included batch file to launch the script on x64 machines or it will crash (sorry). You will need to modify the path in this .bat to point at the .VBS

    I’ve included a sample .CSV to demonstrate formatting.

    [url=“/_imported_xf_attachments/0/414_Scripts.zip?:”]Scripts.zip[/url]

    1 Reply Last reply Reply Quote 0
    • T
      Tom Elliott
      last edited by Oct 15, 2013, 5:36 PM

      Is this feature request/ suggestion something you’re constantly using. My understanding is the IP field is not really needed that much anymore and was slowly being worked out and isn’t really used at all in 0.33b

      I’ll take a look at it this weekend to see what it’s actually trying to do.

      EDIT: I looked a little bit into this, are you making this as a static IP Changer for all hosts in your system?

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      1 Reply Last reply Reply Quote 0
      • T
        Tribble
        last edited by Oct 15, 2013, 5:42 PM

        The script automatically sets a static IP address on any PC from a listing in the .csv file based on the Host name of the PC it’s executed on. Currently I have it running via Snapin. If no listing is found then it stays as it was.

        I use it regularly. I thought it would be nice to be able to edit the CSV file from the host listing.

        EDIT: Yea, the boss is s stickler for Static IP’s

        1 Reply Last reply Reply Quote 0
        • T
          Tom Elliott
          last edited by Oct 15, 2013, 5:44 PM

          Okay,

          I think this is more appropriate, then, as a tool as you’ve already done here. Not everybody is going to want to set hosts statically, so maintaining as a snap-in is appropriate.

          Thank you and awesome work btw.

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 0
          • T
            Tribble
            last edited by Oct 15, 2013, 6:38 PM

            I was hoping for an interface element to make modifying the .csv a little less confusing. A tool does make perfect sense for those IT departments whose managers rely heavily on Static IP’s like ours.

            In my industry, reliability is paramount and we don’t take chances. If a branch server goes down and can’t assign an IP that’s a problem and we avoid potential problems like the plague.

            Yes, i know you can set a static IP from DHCP, Try convincing the paranoid CTO of a bank that it will work just fine lmfao. he keeps giving me this deep dark glare like i’m insane for even considering it.

            (it took me 8 years to convince him that we can reliably use Print servers to manage our printers instead of setting every single one by hand on every PC we installed *i ended up having to make scripts for that too finally until a month or 2 ago XD * and I only managed that miracle after i demonstrated how to use GPO to re-direct them all to another print server in under 10 minutes)

            1 Reply Last reply Reply Quote 0
            • T
              Tribble
              last edited by Oct 31, 2013, 3:26 PM

              Updated:

              The following will now ignore the case of the Computer name by adding the /I argument to the If statement.

              [INDENT=2]@Echo Off[/INDENT]
              [INDENT=2] [/INDENT]
              [INDENT=2]Set csv=\Server\Share\pcsetup\ipchanger\ComputerList.csv[/INDENT]
              [INDENT=2] [/INDENT]
              [INDENT=2]for /f “skip=1 delims=, tokens=1-7” %%a in (%csv%) do ([/INDENT]
              [INDENT=2] if /I “%computername%”==“%%a” ([/INDENT]
              [INDENT=2] [/INDENT]
              [INDENT=2] netsh int ipv4 set address “Local Area Connection” static %%b %%c %%d[/INDENT]
              [INDENT=2] netsh int ipv4 set dnsserver “Local Area Connection” static %%e[/INDENT]
              [INDENT=2] netsh int ipv4 add dnsserver “Local Area Connection” %%f[/INDENT]
              [INDENT=2] netsh int ipv4 add dnsserver “Local Area Connection” %%g[/INDENT]
              [INDENT=2] [/INDENT]
              [INDENT=2] )[/INDENT]
              [INDENT=2])[/INDENT]
              [INDENT=2]REM Pause[/INDENT]
              [INDENT=2]Echo On[/INDENT]

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post

              192

              Online

              12.0k

              Users

              17.3k

              Topics

              155.2k

              Posts
              Copyright © 2012-2024 FOG Project