July 17th, 2013

PowerTip: Use PowerShell to Return Random Computer Names

Doctor Scripto
Scripter

Summary: Learn how to use Windows PowerShell to return random computer names from Active Directory.

Hey, Scripting Guy! Question How can I easily obtain random computer names in Active Directory for audit purposes?

Hey, Scripting Guy! Answer Use the Get-ADComputer cmdlet and pipe the results to the Get-Random cmdlet. The following script selects two random computer names from Active Directory.

Get-ADComputer -Filter * | Get-Random -Count 2

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback