All Forums >> [Scripting] >> WSH & Client Side VBScript >> WMI; BackupEventlog(); Access Denied Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
I have really complex Problem and i am hopefull you can help me.
My VB-Script should save the eventlogs from a remote mashine onto a network storage presented as a share. The share is on a NAS and the permission on the share is "Full Control" for "Everyone".
For backing up the eventlogs i use the BackupEventlog-function from the WMI-service.
I start the script on a mashine local with the rights of an administrator. For the local mashine the script works great. - logs the progress in a textfile on the same share - gets connection to the eventlog - gets the correct size of it - backing it up on a network share - clears the eventlog
Also i log the progress in a from me created textfile which is on the same share too.
Now i start the script again on a remote mashine. - logs the progress in a textfile on the same share - gets connection to the eventlog - gets the correct size of it - trying to back it up ... And now i get the ERROR_CODE 5, when the function BackupEventlog tries to back it up on the network storage. This code means "Access Denied". When i back it up on the local remote mashine it works also fine.
Have anyone an idea with which right the funktion "BackupEventlog" from the WMI-Service uses, when it tries to write on the network share? Or whats the matter with it?
< Message edited by EpoXain -- 9/9/2008 2:18:15 AM >
I tried it with Identify and now i get an error while executing the script. Access Denied. It occurs when i try to open an attribut of the object:
1 set colLogFiles = objWMIService.ExecQuery("Select * from Win32_NTEventlogFile Where Logfilename = '" & strLogName & "'") 2 If colLogFiles.Count <> 1 then
The Error points to line 2 first row.
< Message edited by EpoXain -- 9/9/2008 4:26:14 AM >
In the MSDN Library is written, that the Delegate-Property is only available in Windows 2k. This means probably FROM Win2k. But i got an errer. The Devil only knows, where it came from. But now its running. Fully Unproblematic.
Ok, i was ecxited and a little bit hasty
Delegate was the magic word. Thanks for it!
And sorry, if my english is not as well as expected. I´m a german.
< Message edited by EpoXain -- 9/9/2008 5:49:52 AM >