I am using Powershell script to collect the Operating System and logged-on user information name for the machines in domain.
Script has been given ib the attachment.
Script is accessing the machine which their host names given in a text file and getting OS and looged-on user and appending the information in a csv file for each machine in the domain.
The problem is that if a machine not turned on or the mobile machine not in the office the access time of the script is very long. So scanning all machines is lasting too much.
Could i put a limit for access time to skip the machine if the script can not access in a few seconds?