Categories

Scripting Games – Filter early again

Grading the scripts in Event 4 and the one thing that jumps out is the amount of unnecessary data being carried through the scripts

You were asked for 7 properties off 20 random users

Get-ADUser has a –properties parameter. USE it to restrict the properties you return. You don’t NEED all the other properties

Next select you 20 users as soon as possible

get-aduser | get-random

will do that.  You can then format just the few properties you need on the 20 objects you have left

FILTER EARLY

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>