Options

massive noob question- please help!

94jedi94jedi Member Posts: 177
Hhhhokay, so...

I need to deploy a reg hack. We had a print server crash last week and decided just to get a new machine and scrap the old one. This is the string HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\printserver02.

I need to delete "printserver02" from everyone's pc. Because that machine no longer exists it causes everyone's pc's to lag when printing or when opening docs over the network (in-LAN).

Thanks to my 70-290 studies, I know what to do in AD and where to put the bat file but I need help creating the .reg file and then creating the batch file to call the reg fix. from that point, I can just deploy it via AD in the container for the office in question.

I know, I know...what a noob. I've been studying so much for 70-290 that I've forgotten everything else lol.

HALP?
HAIL TO THE REDSKINS!!!

Comments

  • Options
    joey74055joey74055 Member Posts: 216
    Well to create the registry file you just need to open up the registry, make your edit then go to File, Export, name it and save it. After this you could just put it out on everyones desktop and have them double-click the file and and click on Yes. This will overwrite their registry with the new one. Always use caution with this first before you do it and test it on a test machine.
  • Options
    dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
  • Options
    94jedi94jedi Member Posts: 177
    joey74055 wrote: »
    Well to create the registry file you just need to open up the registry, make your edit then go to File, Export, name it and save it. After this you could just put it out on everyones desktop and have them double-click the file and and click on Yes. This will overwrite their registry with the new one. Always use caution with this first before you do it and test it on a test machine.

    thanks. problem is I need to delete that entire "printserver02" folder as well as the keys in it and apparently, a .reg file can't actually delete things, only add them.
    HAIL TO THE REDSKINS!!!
  • Options
    dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    94jedi wrote: »
    thanks. problem is I need to delete that entire "printserver02" folder as well as the keys in it and apparently, a .reg file can't actually delete things, only add them.

    Go to the regini.exe section in the link I provided.
  • Options
    Megadeth4168Megadeth4168 Member Posts: 2,157
    What about VBS script... maybe something like....

    set objNetwork = CreateObject("wscript.network")
    Set objPrinters = objNetwork.EnumPrinterConnections
    For i = 0 to objPrinters.Count - 1 Step 2
          PrinterPath = objPrinters.Item(i+1)
      if Instr(lcase(PrinterPath), "printserver02") > 0 then
               objNetwork.RemovePrinterConnection PrinterPath, true, true
          end if 
    Next 
    
  • Options
    94jedi94jedi Member Posts: 177
    What about VBS script... maybe something like....

    set objNetwork = CreateObject("wscript.network")
    Set objPrinters = objNetwork.EnumPrinterConnections
    For i = 0 to objPrinters.Count - 1 Step 2
          PrinterPath = objPrinters.Item(i+1)
      if Instr(lcase(PrinterPath), "printserver02") > 0 then
               objNetwork.RemovePrinterConnection PrinterPath, true, true
          end if 
    Next 
    

    I'd like to try that but I know nothing about scripting and how to go about pushing it down via GP...I guess in a log in script lol?
    HAIL TO THE REDSKINS!!!
  • Options
    dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    Create a file called delprint.txt

    Paste this into that:
    \registry\machine\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\printserver02 [DELETE]
    

    Run regini delprint.txt
  • Options
    94jedi94jedi Member Posts: 177
    dynamik wrote: »
    Create a file called delprint.txt

    Paste this into that:
    \registry\machine\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\printserver02 [DELETE]
    

    Run regini delprint.txt

    thanks, now I gotta read the regini portion of the link you posted!
    HAIL TO THE REDSKINS!!!
  • Options
    Tyrant1919Tyrant1919 Member Posts: 519 ■■■□□□□□□□
    We updated to ADMX files and the new features are awesome. Deleting a registry setting globally via GPO is easy with the built in GUI :^D

    reggpo.JPG
    A+/N+/S+/L+/Svr+
    MCSA:03/08/12/16 MCSE:03s/EA08/Core Infra
    CCNA
  • Options
    ClaymooreClaymoore Member Posts: 1,637
    Once you get the regini script working, your next challenge will be deployment. You can write a wrapper script around the regini command (a batch file would be fine) and make sure everyone has access to the delprinter.txt file. You could then deploy the script via login script or a startup script in group policy.

    If you run this in the context of a standard user, it will probably fail since they likely do not have the rights to delete keys in the HKEY_Local_Machine hive. You can use the security settings in group policy to grant everyone the delete right to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers key so the script will run successfully.
  • Options
    94jedi94jedi Member Posts: 177
    Claymoore wrote: »
    Once you get the regini script working, your next challenge will be deployment. You can write a wrapper script around the regini command (a batch file would be fine) and make sure everyone has access to the delprinter.txt file. You could then deploy the script via login script or a startup script in group policy.

    If you run this in the context of a standard user, it will probably fail since they likely do not have the rights to delete keys in the HKEY_Local_Machine hive. You can use the security settings in group policy to grant everyone the delete right to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers key so the script will run successfully.

    well, here's another wrinkle...apparently I have to get rid of EVERY instance of the old printserver to make it work properly. There's about 15 instance so there aren't too many. I guess a script can do 1 or multiple, doesn't really matter right?
    HAIL TO THE REDSKINS!!!
Sign In or Register to comment.