Advertisement
Advertisement
| 05.05.2008 at 10:36AM PDT, ID: 23377077 |
|
[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: |
Dim objFSO
Dim objFile
Dim objNetwork
Dim objStream
Dim strComputer
Dim strComputer2
Const intForReading = 1
Set objNetwork = CreateObject("WScript.Network")
strDomain = objNetwork.UserDomain
strGroupToAdd = strDomain & "/MS - IT Dept"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("computers.txt", intForReading, False)
While Not objFile.AtEndOfStream
'Read a Record
strComputer = objFile.ReadLine
Set objAdmins = GetObject("WinNT://" & strComputer & "/Administrators")
Set objGroup = GetObject("WinNT://" & strGroupToAdd)
On Error Resume Next
objAdmins.Add(objGroup.ADsPath)
If Err.Number <> 0 Then
Err.Clear
On Error GoTo 0
MsgBox "There was an error adding " & strGroupToAdd & " to " & objAdmins.ADsPath
Else
On Error GoTo 0
MsgBox strGroupToAdd & " was added successfully to " & objAdmins.ADsPath
End If
Wend
'Clean up file objects
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing
MsgBox "Done"
|
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 05.05.2008 at 10:40AM PDT, ID: 21501599 |
| 05.05.2008 at 11:08AM PDT, ID: 21501800 |
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: |
Dim objFSO
Dim objFile
Dim objNetwork
Dim objStream
Dim strComputer
Dim strComputer2
Const intForReading = 1
Set objNetwork = CreateObject("WScript.Network")
strDomain = objNetwork.UserDomain
strGroupToAdd = strDomain & "/MS - IT Dept"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("computers.txt", intForReading, False)
On Error Resume Next
While Not objFile.AtEndOfStream
'Read a Record
strComputer = objFile.ReadLine
Set objAdmins = GetObject("WinNT://" & strComputer & "/Administrators")
If Not Err Then
Set objGroup = GetObject("WinNT://" & strGroupToAdd)
objAdmins.Add(objGroup.ADsPath)
If Err Then
Err.Clear
MsgBox "There was an error adding " & strGroupToAdd & " to " & objAdmins.ADsPath
Else
MsgBox strGroupToAdd & " was added successfully to " & objAdmins.ADsPath
End If
Else
'** Computer not found
End If
Wend
On Error Goto 0
'Clean up file objects
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing
MsgBox "Done"
|
| 05.05.2008 at 02:35PM PDT, ID: 21503225 |
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: |
Dim objFSO
Dim objFile
Dim objNetwork
Dim objStream
Dim strComputer
Dim strComputer2
Const intForReading = 1
Set objNetwork = CreateObject("WScript.Network")
strDomain = objNetwork.UserDomain
strGroupToAdd = strDomain & "/MS - IT Dept"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("computers.txt", intForReading, False)
While Not objFile.AtEndOfStream
'Read a Record
strComputer = objFile.ReadLine
If Ping(strComputer) = True Then
On Error Resume Next
Set objAdmins = GetObject("WinNT://" & strComputer & "/Administrators")
If Err.Number <> 0 Then
Err.Clear
On Error GoTo 0
MsgBox "There was an error connecting to the Administrators group on " & strComputer
Else
On Error Resume Next
Set objGroup = GetObject("WinNT://" & strGroupToAdd)
objAdmins.Add(objGroup.ADsPath)
If Err.Number <> 0 Then
Err.Clear
On Error GoTo 0
MsgBox "There was an error adding " & strGroupToAdd & " to " & objAdmins.ADsPath
Else
On Error GoTo 0
MsgBox strGroupToAdd & " was added successfully to " & objAdmins.ADsPath
End If
End If
Else
MsgBox "Could not ping " & strComputer
End If
Wend
'Clean up file objects
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing
MsgBox "Done"
Function Ping(strComputer)
Dim objShell, boolCode
Set objShell = CreateObject("WScript.Shell")
boolCode = objShell.Run("Ping -n 1 -w 300 " & strComputer, 0, True)
If boolCode = 0 Then
Ping = True
Else
Ping = False
End If
End Function
|