I have a GPO with printers mapped via the user preferences. Each printer needs to be item-level targeted only to computers in a specific IP range. I have a list of about 92 ranges that need to be added to a dozen or so printers.
The only way I know of to add an IP range is to do it through the GUI by clicking New Item -> IP address range, then type each of the start and end addresses of the range, then hit Item Options -> OR (default is AND), then hit OK... 1 range at a time... for 12 printers.
There's no way in hell I'm doing this by hand!
Is there a way to script this? Or at least add ranges in a batch?
I can only give you a partial answer:
The Preferences are XML files. You can find the corresponding file here:
\\YOUR_DOMAIN\SYSVOL\DOMAIN_NAME\Policies\ID_OF_THE_GPO\Machine\Preferences\Printers\Printers.xml
and you'll find something like that:
As you can see, the filters are in the
<Filters>
node: so, you can create them with a script/editor for example (I know that this is not necessarily the easyiest part...)EDIT:
To update the GPO version in AD, I recommend that, once you did your modifications in the XML file: open the GPO, change and restore any setting in a user preference, and then close the Group Policy Editor. Thus, the AD will increment the version of the GPO and the clients will properly download the new version.