|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: |
' Usage:
'cscript /nologo inventory.vbs /s:ip.ip.ip.ip /u:user_name /p:password
' Multiple IP's should be comma seperated... IP's could also be dns-name(s)
' if no parametes are given local host and all parameters are run...
'Encrypts WMI Connections
Function ConvertSize(Size)
Do While InStr(Size,",") 'Remove commas from size
CommaLocate = InStr(Size,",")
Size = Mid(Size,1,CommaLocate - 1) & _
Mid(Size,CommaLocate + 1,Len(Size) - CommaLocate)
Loop
Suffix = " Bytes"
If Size >= 1024 Then suffix = " KB"
If Size >= 1048576 Then suffix = " MB"
If Size >= 1073741824 Then suffix = " GB"
If Size >= 1099511627776 Then suffix = " TB"
Select Case Suffix
Case " KB" Size = Round(Size / 1024, 1)
Case " MB" Size = Round(Size / 1048576, 1)
Case " GB" Size = Round(Size / 1073741824, 1)
Case " TB" Size = Round(Size / 1099511627776, 1)
End Select
ConvertSize = Size & Suffix
End Function
Const WbemAuthenticationLevelPktPrivacy = 6
On Error Resume Next
If Wscript.Arguments.Named("u") <> "" And Wscript.Arguments.Named("p") <> "" Then
boolAlternate = True
strUser = WScript.Arguments.Named("u")
strPassword = WScript.Arguments.Named("p")
WScript.Echo "Using alternate credentials..."
Else
boolAlternate = False
WScript.Echo "Using current credentials..."
End If
If WScript.Arguments.Named("s") = "" Then
arrComputers = Array(".")
Else
arrComputers = Split(WScript.Arguments.Named("s"), ",")
End If
For Each strComputer In arrComputers
If boolAlternate = True Then
strNamespace = "root\cimv2"
Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objwbemLocator.ConnectServer(strComputer, strNamespace, strUser, strPassword)
objWMIService.Security_.authenticationLevel = WbemAuthenticationLevelPktPrivacy
Else
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
End If
Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where Description = 'Local Fixed Disk'",,48)
For Each objItem in colItems
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "Size_1: " & objItem.Size
Wscript.Echo "Size: " & ConvertSize(objItem.Size)
Wscript.Echo "Serial: " & objItem.VolumeSerialNumber
Next
Next
|
Advertisement
| Hall of Fame |