Posts Tagged ‘Group Policy’

Clear Cookies and Temporary Internet Files through Group Policy

March 28th, 2013

The best way I have found to remove cookies/temporary internet files is by creating a batch file with the code below and adding this as a logon or logoff script.

ECHO Deleting current Temporary Files, Cookies
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
ECHO Done!

Below is the commands you can execute to clear different items:
History =RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
Cookies =RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
Temporary Internet Files=RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
Form Data =RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16
Stored Passwords =RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32
Delete All=RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
Delete All and Files and Settings Stored by add-ons=RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

Posted in Uncategorized | Comments (0)

Setting Printer Preferences

November 8th, 2011

I have a printer on my Windows 2008 Print Server that despite many attemps and approaching the situation from different ways, I cannot get the preferences that I set on the Print Server to be shared with the rest of the clients.  It is possible that this is a 64-bit/32-bit issue since my server is 64 bit and my clients are Windows 7 32 bit.  We also had to use the Vista driver since there is not a suitable Server 2008/Win 7 Driver.  (The printer in question is a HP DesignJet 1050C ) So after trying to set the preferences from a Win 7 station and that not taking, I figured I would have to find the actual preferences and somehow deploy those.  Surprisingly, there is not a lot of information about location of print preferences, manually replicating print preferences, or otherwise copying/deploying these print preferences.  Here is how I ended up accomplishing this:

This was the big aha moment, it is all stored in the registry and the preferences are all stored in a single binary value. I had found some articles pointing to this location in the registry, but none of them explained the importance of the DevMode binary value.  Source:

1) Create and Export Registry Key:  So on one of the client computers, I set all of the printing preferences settings then proceeded to export the key.  (Important Note: in the key there is a server value that you will want to inspect.  Make sure that if you are going to map this through a FQDN then your server name will need to match here.)  This file will need to be copied to a location that everyone that will map this printer and need its settings, has access to.  (Sysvol on the domain is a potential good place as everyone has access to it, in my case I have a share on one of my file servers that has other reg files that I deploy so I chose this location.)

2) Create Group Policy: I created a group policy that basically would copy the .reg to a folder on the client, copy a .bat file that I created to the windows start menu, and create a folder for the preceding file to reside in.  This is deployed in the computer configuration so that the files will be copied to the computer before a user logs in.

For the group policy:
– Computer Configuration -> Preferences -> Windows Settings -> Files (.reg file that will be copied to the folder below. Example: printer.reg)
– Computer Configuration -> Preferences -> Windows Settings ->Folders (This one will create the folder for your .reg File Example: c:\printprefs)
– Computer Configuration -> Preferences -> Windows Settings -> Files (.bat file (Example printpref.bat)created in same directory as .reg file copied to start menu: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\ )

*** The .bat file would have the following line in it based on the examples above:
reg import c:\printprefs\printer.reg

3) Test: You should be able to restart a computer with this policy and see a folder created, with a .reg file in it.  If you look in the start menu under startup, there should be a .bat file in there that calls the reg file.  You should be able to look at your printers preferences and everything that you set should be not set on the new client.

There is likely more elegant ways to do this, like build the registry key and values through group policy.  But I think that this is more managable as I just have to update one .reg file if the preferences need to change and it is automatically updated on all computers with that group policy without having to modify the group policy.   This is also NOT the standard way to deploy preferences.  You should just be able to jump on the print server open the printer properties, go to the advanced tab, and set the printing defaults. However when that fails like in my case, the above works….


Keywords (these are all of the things I tried googling to come up with this and found very few results….):
Server 2008 print server not saving preferences
duplicating print preferences.
duplicating printing preferences
Deploying printing preferences through group policy
Location of printer preferences
Location of printing preferences
printer preferences not saving

Tags: , ,
Posted in Uncategorized | Comments (0)

Remove/Reset Local Group Policy

October 13th, 2011

If you have a test computer that you use to test group policies, it is important to make sure that you have a clean slate otherwise you might have old policies that you removed lingering on the computer.  Just because you remove a policy from a computer does not mean that it removes the settings of that policy.  The following commands work to reset the local policies on a computer.  I put them in a .bat file so that I can easily reset the policy on my test machine.  This is also useful when troubleshooting group polcies on a  computer that might have moved between OU’s and is not behaving correctly.

Execute the following from a command prompt:

secedit /configure /db reset /cfg “c:\windows\security\templates\setup security.inf” /overwrite

del c:\windows\system32\grouppolicy\machine\registry.pol

del c:\windows\system32\grouppolicy\user\registry.pol

For WIN 7:

secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose

*Note: This does not remove everything that you might have configured through group policy such as registry changes, software installation, custom startup scripts, etc.  This only impacts configurations of group policies itself.

Tags: , ,
Posted in Uncategorized | Comments (0)

Shared printers not able to be added from Server 2008 R2 Print Server

September 2nd, 2010


Shared printers not able to be added from Server 2008 R2 Print Server Posted By: Larry Woods Date: 8/20/2010

Keywords: Group Policy object did not apply because it failed with error code ‘0x80070709 The printer name is invalid.’ This error was suppressed., Check Printer Name


Windows 7 Client, Server 2008 R2 Print Server


When trying to connect to printers that were being deployed through group policy an error is logged on the client: Group Policy object did not apply because it failed with error code ‘0x80070709 The printer name is invalid.’ This error was suppressed. If you manually browse to the FQDN server name and double click on the printer it will give you an error to check the printer name. However if you browse to the NetBIOS name it will allow you to add the printer.


I found the following websites: The pertinent information is: Enable CNAMEs (or alternate non DNS Strict Names) on print servers
If you can ping the print server and authenticate, but the server still fails it is likely you need to enable this setting on the server for CNAMEs to work on print servers.

Type this in at a command prompt:
reg add HKLM\SYSTEM\CurrentControlSet\Control\Print /v DnsOnWire /t REG_DWORD /d 1

In my case the DNS situation caused this issue. Its public and internal Fully Qualified DNS Name (\\ was differend from its Fully Qualified Domain Name (\\ When trying to add the printer, the printer server does a check and sees that you are trying to add the printer as the fully qualified dns name and errors out because it can only serve the printer as the fully qualified domain name.

Tags: , , ,
Posted in Uncategorized | Comments (0)