We have been given a task of changing the IP Addresses of our Network Printers (Actual Printer), which luckily will be carried out by our Local HP LaserJet Partner Technicians all 80 Printers on all sites.
While my team is assigned to changes all configured Shared Printer IP Address.
We are talking about the one recorded/configured under Printer Properties--->under "Ports" Section, Printer IP Address Setting) on all workstation which I believed time consuming and manpower entensive task.
1 Computer at least 4 Network Printers are configured.
We are planning to deploy a script via SCCM 2012 however I am not lucky to find a working script.
We are targeting Windows XP, Windows 7, and Windows 8 OS Versions.
I came to browse some details on the forums but it works on XP, however I tried on Windows 7 it didn't work at all:
https://social.technet.microsoft.com/Forums/scriptcenter/en-US/65487281-a8e0-485a-8ffe-1341d2e0b2f0/change-the-ip-address-of-existing-printer-port?forum=ITCG
I just follow the script on the above forum by
Bartek Bielawski: However I cant figure out what went wrong.
Scriptsample.bat
set IPToReplace=192.168.1.150
set NewIP=192.168.1.100 @echo off
for/f "delims="%%I
in ('reg query "HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports"')do @call :CheckIP %%I
goto :EOF
:CheckIP
:: Need to replace "HKEY_LOCAL_MACHINE" with"HKLM"
set KEY=%*
set KEY=HKLM%KEY:~18%
reg query "%KEY%"
/v IPAddress 2> nul | find "%IPToReplace%"> nul || goto :EOF
:: Found printer ports with given IP
reg add "%KEY%"
/v IPAddress /t REG_SZ
/d %NEWIP%/f
Output
1. The Registry Entry has been changes from 192.168.1.150 to 192.168.1.100 successfully check in the Registry.
2. System/Computer Has been restarted, check on the Registryonce again (for the Shared Printer "PORTS" IP Address settings) the IP is 192.168.1.100 still in the registry which is good.
3. Check the "HP ColorLaserjet" Printer Propertieswith the previous IP Address of 192.168.1.150, on the "Port" the previous IP Address which is 192.168.1.150 still there however "Unchecked", the new IP Address 192.168.1.100 did not register.
Any help and suggestions? Maybe the above script needs few commands modification. Or maybe I need a deferent type of Script kindly share.