Login | |
|
 |
RE: RemoveLocalAdmin - Excel Log - 7/18/2006 2:52:19 AM
|
|
 |
|
| |
Country73
Posts: 712
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
|
Sorry, wasn't around any computers yesterday. Are you actually receiving the error on this line: strInfo = strInfo & "," & objUser.Name & " \ " & objUser.Fullname Are you receiving the error on a specific machine you run this against, or any machine you attempt to run it against?
|
|
| |
|
|
|
 |
RE: RemoveLocalAdmin - Excel Log - 7/19/2006 5:08:00 AM
|
|
 |
|
| |
Country73
Posts: 712
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
|
Depending on what program you are using to write your scripts in (PrimalScript, notepad, etc...), and what all you have actually modified on the script to fit your needs, it makes it a little difficult to determine what Line: 113 is and what would be causing the error. According to my editor (TextPad), Line 113 = call verifyAccount(strComputer) (By the way, my last response was on the wrong script, sorry about that) If you can copy the line of code you are getting the error message on, then I'll see what I can figure out for you. If you have made multiple modifications to the script, then I may need to see the whole thing to figure out what is going on. Let's first start with you posting the exact line the script is erroring on.
|
|
| |
|
|
|
 |
RE: RemoveLocalAdmin - Excel Log - 7/19/2006 7:30:04 AM
|
|
 |
|
| |
Country73
Posts: 712
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
|
I'll have to double check on the script that I posted, but it looks like I might have missed a NEXT in there; also make sure you enter in your domain where I have corp listed. (I used that as a filler for the domain and should have mentioned that in my initial post of the script; I'll edit that when I go back over my initial post of the script) FUNCTION stripMachine(myLine,strCount) fSplit = Split(myLine,";") strComputer = fSplit(0) wscript.echo strCount & vbTab & strComputer strCount = strCount - 1 Set cPingResults = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery("SELECT * FROM Win32_PingStatus WHERE Address = '" + strComputer + "'") For Each oPingResult In cPingResults If oPingResult.StatusCode <> 0 Then call LogEvent(strComputer) Exit Function End If For i = 1 to UBound(fSplit) Set colGroups = GetObject("WinNT://" & strComputer & "") colGroups.Filter = Array("group") For Each oGroup In colGroups If (oGroup.Name = "Administrators") Then For Each oUser in oGroup.Members If LCase(oUser.Name) = LCase(fSplit(i)) Then oShell.Run oCMGR & "-u ""corp\" & fSplit(i) & """ -m " & strComputer & " -dlg ""Administrators""",0,True End If Next End If Next Next Next call verifyAccount(strComputer) End Function Let me know if that fixes it for you!
|
|
| |
|
|
|
 |
RE: RemoveLocalAdmin - Excel Log - 7/19/2006 11:28:10 PM
|
|
 |
|
| |
Country73
Posts: 712
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
|
Glad to hear it's working correctly for you; and it's really my bad for missing that "NEXT" in my original posting of the code.
|
|
| |
|
|
|
|
|