Re: Script retuning error on remote machine




"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
--


.



Relevant Pages

  • Re: Script retuning error on remote machine
    ... i found out an interesting fact about WMI. ... remote system, and so it is tryin gto save the files on the remote system, ... You cannot connect to computers running XP Home. ... W2k3 can only connect to Win9x and NT if credentials supplied. ...
    (microsoft.public.scripting.vbscript)
  • Re: How to remote access WMI interface on NT
    ... Could you tell how to access WMI on NT server? ... You cannot connect to computers running XP Home. ... W2k3 can only connect to Win9x and NT if credentials supplied. ... Microsoft MVP Scripting and ADSI ...
    (microsoft.public.scripting.vbscript)
  • Win32_StartupCommand lists system32 files
    ... computers still return the expected data. ... The Win32_StartupCommand query not only returns the expected data (the ... I reinstalled WMI, per these instructions: ... I also ran the WMI script remotely, from an older Dell NT5.0 workstation, ...
    (microsoft.public.win32.programmer.wmi)
  • Help!! Installation of TWAIN Scanner causes WMI Access Denied with Domain Admin rights
    ... some admin scripting in windows using wmi. ... Then I installed a scanner on one of the computers and installed the ... with the same script code and credentials. ... installation was the problem, and confirmed this on a third computer. ...
    (microsoft.public.win32.programmer.wmi)
  • Re: WMI Delays
    ... throughout the network that do ping but are not WMI units. ... you could use ADO to retrieve the NetBIOS names of all computers ... This will include machines recently turned off, ...
    (microsoft.public.scripting.vbscript)

Quantcast