Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try
- {
- $CS = Get-WmiObject -Class Win32_ComputerSystem -ComputerName $Computer -ErrorAction Stop
- $BS = Get-WmiObject -Class Win32_Bios -ComputerName $Computer -ErrorAction Stop
- $OS = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $Computer -ErrorAction Stop
- }
- catch
- {
- "$(get-date) - $computer failed the wmi call!" | out-file c:\errorlog.txt -Append
- $error[0].Exception.Message | out-file c:\errorlog.txt -Append
- break
- }
Advertisement
Add Comment
Please, Sign In to add comment