header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Unable to backup event logs on local computer
Last Post 24 Jun 2010 02:23 AM by sdevoy. 2 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
sdevoyUser is Offline
New Member
New Member
Posts:4
Avatar

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

    YogeshUser is Offline
    New Member
    New Member
    Posts:30
    Avatar

    --
    23 Jun 2010 07:23 AM
    please let me know the share and ntfs permission of the folder that contain the logs


    sdevoyUser is Offline
    New Member
    New Member
    Posts:4
    Avatar

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


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer