Re: Script retuning error on remote machine
- From: "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 29 Aug 2007 17:50:17 -0500
"blankmonkey" <loftyworm@xxxxxxxxxxx> wrote in message
news:581f097ac984484c9bfa4c000b39d67e@xxxxxxxxxxxxxx
I have the following script. I works fine for the local machine, but when
I
try to run it on a remote system, it is failing with;
NTLMLogin resulted in hr = 0x8004100e
I am completely lost, please help :(
strComputer = "REMOTE_COMPUTER"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Backup)}!\\" & _
strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile where LogFileName='Application'")
For Each objLogfile in colLogFiles
errBackupLog = objLogFile.BackupEventLog("c:\scripts\application.evt")
If errBackupLog <> 0 Then
Wscript.Echo "The Application event log could not be backed up."
Else
objLogFile.ClearEventLog()
End If
Next
Some time ago I researched how to connect to remote computers with WMI and
found the following:
1. You cannot connect to computers running XP Home.
2. An NT computer cannot connect to OS later than W2k.
3. A W2k3 computer cannot connect to Win9x.
4. To connect to W2k Server SP4 you must set impersonation level to
Impersonate.
5. W2k computers must have SP2 to connect to XP or above.
6. W2k3 can only connect to Win9x and NT if credentials supplied.
7. To connect to XP or W2k3 you must set authentication level to Pkt.
I determined this before Vista came out, so I need to add to the list.
For best compatibility I specify authenticationLevel, as in:
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
& strComputer & "\root\cimv2")
Also, WMI can become corrupt. It can also be blocked by a firewall or DCOM
can be disabled. Sometimes stopping and starting the WMI service helps.
Otherwise, see these links on troubleshooting WMI:
http://www.microsoft.com/technet/scriptcenter/topics/help/wmi.mspx
http://support.microsoft.com/kb/875605
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
.
- Follow-Ups:
- Re: Script retuning error on remote machine
- From: blankmonkey
- Re: Script retuning error on remote machine
- From: blankmonkey
- Re: Script retuning error on remote machine
- References:
- Script retuning error on remote machine
- From: blankmonkey
- Script retuning error on remote machine
- Prev by Date: Re: FileSystemObject versus Application (in the world series of lo
- Next by Date: Re: Passing window object outside and HTML Application
- Previous by thread: Script retuning error on remote machine
- Next by thread: Re: Script retuning error on remote machine
- Index(es):
Relevant Pages
|