Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

script keeps freezing at same spot

$
0
0

when running scripts i keep coming across the following issue - for example, if i run a script to gather the computer name, model, serial number etc from AD it gets stuck on 1 pc-- multiple scripts have the same issue.

how can i adjust the following script to skip or pass the problem pc if it takes longer then lets say a minute to respond to the request from the script.

below is an example of the script being used:


Get-ADComputer -ResultPageSize 1000 -searchbase "OU" -filter * -Properties * | Sort-Object -property name |
     select @{N="Computer";E={$_.Name }},
            @{N="Memory";E={(Get-WmiObject -Class Win32_OperatingSystem -cn $_.Name).TotalVisibleMemorySize}},
            @{N="Model";E={(Get-WmiObject -Class Win32_computerSystem -cn $_.Name).Model}}, 
            @{N="Serial Number";E={(Get-WmiObject Win32_bios -cn $_.Name).SerialNumber}},
            @{N="Manufacturer"; E={(Get-WmiObject Win32_ComputerSystem -cn $_.Name).Manufacturer }} | export-csv C:\temp\pcinfo01.csv

thank you.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>