PowerTip: Use PowerShell to Return Random Computer Names

Doctor Scripto

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

0 comments

Discussion is closed.

Feedback usabilla icon