Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell to Return Random Computer Names

$
0
0

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


Viewing all articles
Browse latest Browse all 3333

Trending Articles