cls ############################################################################################################## Get-ChildItem -recurse C:\Install_Files\GitHub\PoshRSJob | Unblock-File Import-Module -name C:\Install_Files\GitHub\PoshRSJob\PoshRSJob -verbose ############################################################################################################## 1..20 | Start-RSJob -throttle 5 -name {$_} -scriptBlock {Start-Sleep -Seconds (Get-Random (1..7))} | Wait-RSJob cls ############################################################################################################## Get-ChildItem -recurse C:\Install_Files\GitHub\PoshRSJob | Unblock-File Import-Module -name C:\Install_Files\GitHub\PoshRSJob\PoshRSJob -verbose ############################################################################################################## import-module activeDirectory Get-Date -format "yyyy.MM.dd.HHmmss" > "C:\Temp\ParallelizationTestOutput.txt" $WindowsServers = $null $WindowsServers = Get-ADComputer -Filter {OperatingSystem -Like "*Windows*Server*"} -Property Name If ($WindowsServers -ne $null) { $WindowsServers | Start-RSJob -throttle 2 -name {$_.Name} -scriptBlock { If (Test-Connection -ComputerName $_.Name -Count 2 -Delay 1 -Quiet) { $NICs = $null $NICs = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName $_.Name If ($NICs -eq $null) { $outputLine = $_.Name + " had a WMI connection error (or it had no IP NICs, which is unlikely)." $outputLine >> "C:\Temp\ParallelizationTestOutput.txt" } Else { $NICNumber = 0 ForEach($NIC in $NICs) { $NICNumber = $NICNumber + 1 $outputLine = $_.Name + " " + $NICNumber + " " + $NIC.MACAddress + " " + $NIC.Description + " " + $NIC.IPAddress $outputLine >> "C:\Temp\ParallelizationTestOutput.txt" } } } Else { $outputLine = $_.Name + " did not respond to PING." $outputLine >> "C:\Temp\ParallelizationTestOutput.txt" } } | Wait-RSJob } Else { "Get-ADComputer failed." >> "C:\Temp\ParallelizationTestOutput.txt" }