In the followong script I check disk space for all the servers in the Array. When I have 6 servers in the array, 3 of them error with "Permission Denied." However, if I place one at a time in the array, they all work. For example, if I only put the server "psiacct" in the array, it works fine. If I put 5 more servers in the array, then psiacct errors out "Permission denied." I am running the script from my workstation with full admin rights.
Any ideas? I only put the first part of the script in relavent to the problem.
'FreeSpace.vbs Barry Hohstadt 12/15/03
'Determines if free space on server disks falls below 400MB and write results to log.
On Error Resume Next
Const CONVERSION_FACTOR = 1048576 'converts to MB
Const WARNING_THRESHHOLD = 400 'in MB
'Modify array to add or remove servers.
Computers = Array("psipro", "psiacct", "psiterm", "psisql", "psiweb"
For Each Computer In Computers
Set objWMIService = GetObject ("winmgmts://" & computer)
If Err.Number <> 0 Then
Wscript.Echo Computer & " " & Err.Description
Err.Clear
Else
set colLogicalDisk = objWMIService.InstancesOf ("win32_LogicalDisk"
For Each objLogicalDisk In colLogicalDisk
Any ideas? I only put the first part of the script in relavent to the problem.
'FreeSpace.vbs Barry Hohstadt 12/15/03
'Determines if free space on server disks falls below 400MB and write results to log.
On Error Resume Next
Const CONVERSION_FACTOR = 1048576 'converts to MB
Const WARNING_THRESHHOLD = 400 'in MB
'Modify array to add or remove servers.
Computers = Array("psipro", "psiacct", "psiterm", "psisql", "psiweb"
For Each Computer In Computers
Set objWMIService = GetObject ("winmgmts://" & computer)
If Err.Number <> 0 Then
Wscript.Echo Computer & " " & Err.Description
Err.Clear
Else
set colLogicalDisk = objWMIService.InstancesOf ("win32_LogicalDisk"
For Each objLogicalDisk In colLogicalDisk