Re: Script retuning error on remote machine
- From: blankmonkey <blankmonkey@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 30 Aug 2007 11:50:08 -0700
Victory!!!
Kinda.
Ok, i found out an interesting fact about WMI. the command is running on a
remote system, and so it is tryin gto save the files on the remote system,
and the c:\scripts\ directory did not exist on the remote system. I created
it, and all went well.
But this causes a new problem, I tried this;
errBackupLog = objLogFile.BackupEventLog("\\LOCAL_SERVER\c$\" &
strBackupName & "_" & objLogfile.LogFileName)
But it did not like the network FQDN.
Am I writing this wrong?
or
How can a VBScript copy the files off the remote system to a central location?
"Richard Mueller [MVP]" wrote:
.
"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
--
- References:
- Script retuning error on remote machine
- From: blankmonkey
- Re: Script retuning error on remote machine
- From: Richard Mueller [MVP]
- Script retuning error on remote machine
- Prev by Date: File and folder auditing
- Next by Date: Re: DOS command in VB script
- Previous by thread: Re: Script retuning error on remote machine
- Next by thread: NET SEND
- Index(es):
Relevant Pages
|