Created
April 5, 2016 23:51
-
-
Save Windos/84afc4c0ae99923e5fba1fe2718bfc4f to your computer and use it in GitHub Desktop.
Random selection of Objects (Dumb and Smart)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dumb | |
$Count = ($ADComputer | Measure-Object).Count | |
$Random = Get-Random -Minimum 0 -Maximum $Count | |
$CandidateComputer = $ADComputer[$Random] | |
# Smart | |
$CandidateComputer = Get-Random -InputObject $ADComputer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment