Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
Active Directory
Unable to backup event logs on local computer
Last Post 24 Jun 2010 02:23 AM by
sdevoy
. 2 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
sdevoy
New Member
Posts:4
23 Jun 2010 06:02 AM
I have the following script that gathers a list of computers from AD, then copies the alert logs of each computer to a central location.
The script runs fine on all remote computers, but when it tries to copy the local event logs it errors 'Access Denied'.
I have tried running the script on several servers with the same result, all event logs are copied apart from the local host the script is run on. The script is not mine I found it on the net.
Any help would be appreciated, I've attached the scipt as BackUpAndClearEventLogs.txt
BackUpAndClearEventLogs.txt
Yogesh
New Member
Posts:30
23 Jun 2010 07:23 AM
please let me know the share and ntfs permission of the folder that contain the logs
sdevoy
New Member
Posts:4
24 Jun 2010 02:23 AM
I don't think it a file or share permissions issue as it is the eventlog backup that fails:
PS C:\Powershell_Scripts> .\BackUpAndClearEventLogs.ps1 -computers "ddnams1"
+ Processing ddnams1
Exception calling "BackupEventlog" : "Access denied "
At C:\Powershell_Scripts\BackUpAndClearEventLogs.ps1:63 char:46
+ $ErrBackup = ($log.BackupEventLog( <<<< $path)).ReturnValue
Copy-Item : Cannot find path '\\ddnams1\c$\LogFolder\ddnams1-Logs-240610\Application.evt' because it does not exist.
At C:\Powershell_Scripts\BackUpAndClearEventLogs.ps1:82 char:11
+ Copy-Item <<<< -path $path -dest "$LogsArchive\$folder" -force
Exception calling "BackupEventlog" : "Access denied "
At C:\Powershell_Scripts\BackUpAndClearEventLogs.ps1:63 char:46
+ $ErrBackup = ($log.BackupEventLog( <<<< $path)).ReturnValue
Copy-Item : Cannot find path '\\ddnams1\c$\LogFolder\ddnams1-Logs-240610\Internet Explorer.evt' because it does not exi
st.
At C:\Powershell_Scripts\BackUpAndClearEventLogs.ps1:82 char:11
+ Copy-Item <<<< -path $path -dest "$LogsArchive\$folder" -force
Exception calling "BackupEventlog" : "Access denied "
At C:\Powershell_Scripts\BackUpAndClearEventLogs.ps1:63 char:46
+ $ErrBackup = ($log.BackupEventLog( <<<< $path)).ReturnValue
Copy-Item : Cannot find path '\\ddnams1\c$\LogFolder\ddnams1-Logs-240610\Security.evt' because it does not exist.
At C:\Powershell_Scripts\BackUpAndClearEventLogs.ps1:82 char:11
+ Copy-Item <<<< -path $path -dest "$LogsArchive\$folder" -force
Exception calling "BackupEventlog" : "Access denied "
At C:\Powershell_Scripts\BackUpAndClearEventLogs.ps1:63 char:46
+ $ErrBackup = ($log.BackupEventLog( <<<< $path)).ReturnValue
Copy-Item : Cannot find path '\\ddnams1\c$\LogFolder\ddnams1-Logs-240610\System.evt' because it does not exist.
At C:\Powershell_Scripts\BackUpAndClearEventLogs.ps1:82 char:11
+ Copy-Item <<<< -path $path -dest "$LogsArchive\$folder" -force
Exception calling "BackupEventlog" : "Access denied "
At C:\Powershell_Scripts\BackUpAndClearEventLogs.ps1:63 char:46
+ $ErrBackup = ($log.BackupEventLog( <<<< $path)).ReturnValue
Copy-Item : Cannot find path '\\ddnams1\c$\LogFolder\ddnams1-Logs-240610\Windows PowerShell.evt' because it does not ex
ist.
At C:\Powershell_Scripts\BackUpAndClearEventLogs.ps1:82 char:11
+ Copy-Item <<<< -path $path -dest "$LogsArchive\$folder" -force
PS C:\Powershell_Scripts>
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
Active Directory
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2