Giter Club home page Giter Club logo

printers's People

Contributors

coasterkaty avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dschumm1 bchnkr

printers's Issues

Printers not added

Hello, thank you for such a cool script.
How can I determine why the script does not add a printer?
It does a good job of cleaning, but it does not add new or modified printers.

Nested or multiple filter collections

Hi !
First of all thanks a lot for this script, it's a very nice one to work with :)

I have some issues with nested filter collections, the filter function doesn't seem to work (at least for me ?).

For example, if I have in my xml

         <Filters>
		<FilterCollection bool="AND" not="0">
		    <FilterOrgUnit bool="AND" not="1" name="a" userContext="0" directMember="0"/>
                    <FilterOrgUnit bool="AND" not="0" name="b" userContext="0" directMember="0"/>
 			 <FilterCollection bool="AND" not="0">
				<FilterGroup bool="AND" not="0" name="x" userContext="1" directMember="0"/>
				<FilterGroup bool="OR" not="0" name="y" userContext="1" directMember="0"/>
				<FilterGroup bool="OR" not="0" name="z" userContext="1" directMember="0"/>					
			</FilterCollection>
		</FilterCollection>
	</Filters>

Which looks like this in gpp editor
Sans titre

Even if the first collection conditions are not met, printer will be deployed if the second collection conditions are met.

If I change the rules to be like this :

                 <Filters>	
			<FilterCollection bool="AND" not="0">		
			    <FilterOrgUnit bool="AND" not="1" name="an" userContext="0" directMember="0"/>
			    <FilterOrgUnit bool="AND" not="0" name="b" userContext="0" directMember="0" />
			</FilterCollection>
			<FilterCollection bool="AND" not="0">
				<FilterGroup bool="AND" not="0" name="x" userContext="1" directMember="0"/>
				<FilterGroup bool="OR" not="0" name="y" userContext="1" directMember="0"/>
				<FilterGroup bool="OR" not="0" name="as" userContext="1" directMember="0"/>
			</FilterCollection>	
	    </Filters> 

Which looks like this in gpp editor
Sans titre1

Even if the second collection conditions are not met, printer will be deployed (because the first collection conditions are met).

Thanks !

Computer OU Item Level Targeting Being Ignored

Hi,
First of all, thank you for taking the time to write and share your script. It's been invaluable in solving the many issues we've seen with shared printers through group policy preferences, where a printer can appear on a login one day, then disappear the next. :)

I have been testing out your script within our domain, and for the most part, it works very well. What I have discovered is that if the printer is assigned to a computer within an OU, without specifying a user group, then it's added to all logins everywhere. I've got around this for the most part by adding in a second check for the user against a user group or groups, which as it's good practice anyway, and really, I should have done that from the start, I'm good with that as a solution.

What I can't figure out, with my very limited Powershell knowledge and debugging techniques, is why, no matter what I do to the item level targeting on the following three printers, they appear on any computer.

<SharedPrinter clsid="{9A5E9697-9095-436d-A0EE-4D128FDFBCE5}" name="School 1-061 Business Ed" status="5389P900016" image="2" changed="2021-05-21 11:44:23" uid="{89466D86-F024-48E3-99AF-E18F3FDFCF33}" userContext="1" bypassErrors="1"><Properties action="U" comment="" path="\\printer.school.domain\5389P900016" location="" default="1" skipLocal="0" deleteAll="0" persistent="0" deleteMaps="0" port=""/><Filters><FilterCollection bool="AND" not="0"><FilterOrgUnit bool="OR" not="0" name="OU=Business Studies 1-061,OU=Business Studies,OU=Enterprise,OU=Pupils,OU=School1,OU=Secondary,OU=Computers,OU=Schools W10,DC=School,DC=Domain" userContext="0" directMember="0"/><FilterOrgUnit bool="OR" not="0" name="OU=Computer Studies 1-060,OU=Computing,OU=Enterprise,OU=Pupils,OU=School1,OU=Secondary,OU=Computers,OU=Schools W10,DC=School,DC=Domain" userContext="0" directMember="0"/></FilterCollection><FilterGroup bool="AND" not="0" name="School\G SchoolStudents" sid="S-1-5-21-2723276998-1066919283-1565034395-81442" userContext="1" primaryGroup="0" localGroup="0"/></Filters></SharedPrinter>

<SharedPrinter clsid="{9A5E9697-9095-436d-A0EE-4D128FDFBCE5}" name="School 1-058 Business Ed" status="5389P900017" image="2" changed="2021-05-21 12:47:57" uid="{9C177E2D-AC6B-4DB5-9FDA-AAE66D0ED090}" userContext="1" bypassErrors="1"><Properties action="U" comment="" path="\\printer.school.domain\5389P900017" location="" default="1" skipLocal="0" deleteAll="0" persistent="0" deleteMaps="0" port=""/><Filters><FilterCollection bool="AND" not="0"><FilterOrgUnit bool="OR" not="0" name="OU=Business Studies 1-058,OU=Business Studies,OU=Enterprise,OU=Pupils,OU=School1,OU=Secondary,OU=Computers,OU=Schools W10,DC=School,DC=Domain" userContext="0" directMember="0"/><FilterOrgUnit bool="OR" not="0" name="OU=Computer Studies 1-054,OU=Computing,OU=Enterprise,OU=Pupils,OU=School1,OU=Secondary,OU=Computers,OU=Schools W10,DC=School,DC=Domain" userContext="0" directMember="0"/></FilterCollection><FilterGroup bool="AND" not="0" name="School\G SchoolStudents" sid="S-1-5-21-2723276998-1066919283-1565034395-81442" userContext="1" primaryGroup="0" localGroup="0"/></Filters></SharedPrinter>

<SharedPrinter clsid="{9A5E9697-9095-436d-A0EE-4D128FDFBCE5}" name="School 1-057 Business Ed" status="5389P900038" image="2" changed="2021-05-21 12:47:33" uid="{16775890-B060-4FC0-8292-5FCBC8698D89}" userContext="1" bypassErrors="1"><Properties action="U" comment="" path="\\printer.school.domain\5389P900038" location="" default="1" skipLocal="0" deleteAll="0" persistent="0" deleteMaps="0" port=""/><Filters><FilterCollection bool="AND" not="0"><FilterOrgUnit bool="OR" not="0" name="OU=Business Studies 1-057,OU=Business Studies,OU=Enterprise,OU=Pupils,OU=School1,OU=Secondary,OU=Computers,OU=Schools W10,DC=School,DC=Domain" userContext="0" directMember="0"/><FilterOrgUnit bool="OR" not="0" name="OU=Business Studies 1-055,OU=Business Studies,OU=Enterprise,OU=Pupils,OU=School1,OU=Secondary,OU=Computers,OU=Schools W10,DC=School,DC=Domain" userContext="0" directMember="0"/><FilterOrgUnit bool="OR" not="0" name="OU=Business Studies 1-056,OU=Business Studies,OU=Enterprise,OU=Pupils,OU=School1,OU=Secondary,OU=Computers,OU=Schools W10,DC=School,DC=Domain" userContext="0" directMember="0"/></FilterCollection><FilterGroup bool="AND" not="0" name="School\G SchoolStudents" sid="S-1-5-21-2723276998-1066919283-1565034395-81442" userContext="1" primaryGroup="0" localGroup="0"/></Filters></SharedPrinter>

What I can say from testing is that deployment was across all user groups until I added in the user group item level target, and then they only appeared for students. If I change that group to staff, then they only appeared everywhere for staff. It doesn't matter if those targeted OUs were within or out with a collection, or even stripped down to an individual OU the end result is the exactly same. From putting in various breakpoints and checks on the script, I think I narrowed down the issue to the evaluatefilters function returning a wrong boolean on a check to see whether the OU was user or computer, and the whole thing going wrong from there, but that was a week or two back and other work got in the way, the test debug script was lost, so I can't confirm if this is 100% true or not. For that I apologise.

Other printers that contain computer item level targets, such as:

<SharedPrinter clsid="{9A5E9697-9095-436d-A0EE-4D128FDFBCE5}" name="School 2-001 Library" status="5389P900037" image="2" changed="2021-05-21 11:44:59" uid="{69EA519F-D6EF-4C56-9DF3-5760857F5DD4}" userContext="1" bypassErrors="1"><Properties action="U" comment="" path="\\printer.school.domain\5389P900037" location="" default="1" skipLocal="0" deleteAll="0" persistent="0" deleteMaps="0" port=""/><Filters><FilterOrgUnit bool="AND" not="0" name="OU=Library,OU=Pupils,OU=School1,OU=Secondary,OU=Computers,OU=Schools W10,DC=School,DC=Domain" userContext="0" directMember="0"/><FilterGroup bool="AND" not="0" name="School\G SchoolStudents" sid="S-1-5-21-2723276998-1066919283-1565034395-81442" userContext="1" primaryGroup="0" localGroup="0"/></Filters></SharedPrinter>

work as intended. I'm thinking this may have something to do with the string length of the OUs in question?

The full XML code of printers I've been testing against is attached to this post, along with screen grabs of example printer targeting.

Not Working
printers - non working

Working
printers working

If you have any further questions, need clarification on any point, or need me to assist in running tests or debugging, I am more than happy to help.

Cheers,
Mark

printers.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.