Prin utilizarea acestui site, sunteți de acord cu Politica de confidențialitate.
Accepta
EnterinITEnterinITEnterinIT
  • ACASĂ
  • IT PRO
  • TECH
  • MICROSOFT
    • Azur
    • ConfigMgr/SCCM
    • DPM
    • Orchestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Birou 365
    • Office Insider
    • Power BI
    • Skype
    • SQL Server
    • Echipe
  • WINDOWS
    • Centrul de administrare Windows
    • Client Windows
    • Windows Server
  • Lista de colecție de interogări SCCM
Lectură: PowerShell Export remote PC event logs to local PC
Redimensionare fontAa
EnterinITEnterinIT
Redimensionare fontAa
  • ACASĂ
  • IT PRO
  • TECH
  • MICROSOFT
  • WINDOWS
  • Lista de colecție de interogări SCCM
Căutare
  • ACASĂ
  • IT PRO
  • TECH
  • MICROSOFT
    • Azur
    • ConfigMgr/SCCM
    • DPM
    • Orchestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Birou 365
    • Office Insider
    • Power BI
    • Skype
    • SQL Server
    • Echipe
  • WINDOWS
    • Centrul de administrare Windows
    • Client Windows
    • Windows Server
  • Lista de colecție de interogări SCCM
IT Pro

PowerShell Export remote PC event logs to local PC

Publicat februarie 12, 2024
3 Min Read
SHARE

PowerShell Export remote PC event logs to local PC.

1. Open Powershell ISE with an account that has local admin access to remote PCs.

NOTE: You also need to have the Sysinternals Tools installed and be able to call psloglist with a prior reference to its path pre-defined:

Set-Alias psloglist c:\windows\system32\psloglist.exe

2. Function calls for remote System Event logs;

Replace the REMOTE-PCNAME with the NetBIOS name of the PC you want to connect to and extract the logs from. The “start notepad” command should then open the log file on your PC to review. Asemenea, you can change the last string or even delete it if you use another tool for logs. (as an example Cmtrace or Notepad++)

function GetSysEventLogs
{ 
         $currDate = get-date -format MMddyyyy 
         $getDayDuration = Read-Host "Please enter the number of days of logs to extract" 
         psloglist \\REMOTE-PCNAME -d $getDayDuration -s system > c:\logs\REMOTE-PCNAME-sysevtlogs-$currDate.txt 
         Write-Host "Event logs saved to c:\logs\REMOTE-PCNAME-sysevtlogs-$currDate.txt" 
         start notepad c:\logs\REMOTE-PCNAME-sysevtlogs-$currDate.txt

}

3. Function calls for remote Application Event logs;

function GetAppEventLogs

{ 
         $currDate = get-date -format MMddyyyy 
         $getDayDuration = Read-Host "Please enter the number of days of logs to extract" 
         psloglist \\REMOTE-PCNAME -d $getDayDuration -s application > c:\logs\REMOTE-PCNAME-appevtlogs-$currDate.txt 
         Write-Host "Event logs saved to c:\logs\REMOTE-PCNAME-appevtlogs-$currDate.txt" 
         start notepad c:\logs\REMOTE-PCNAME-appevtlogs-$currDate.txt

}

4. Function calls for remote Security Event logs;

function GetSecEventLogs
{ 
         $currDate = get-date -format MMddyyyy 
         $getDayDuration = Read-Host "Please enter the number of days of logs to extract" 
         psloglist \\REMOTE-PCNAME -d $getDayDuration -s security > c:\logs\REMOTE-PCNAME-secevtlogs-$currDate.txt 
         Write-Host "Event logs saved to c:\logs\REMOTE-PCNAME-secevtlogs-$currDate.txt" 
         start notepad c:\logs\REMOTE-PCNAME-secevtlogs-$currDate.txt

}

Steps that this script do:
1) Prompt you for how many days of logs you want to extract out
2) Connect to the remote machine
3) Export the specific log to a *.TXT file
4) Copy the log back to your computer into c:\logs\
5) Open the file in Notepad

Etichetat:PowerShellWindowsWindows 10
Articolul precedent DPM Delete a specific Recovery Point
Articolul următor Power BI Desktop June 2019 Update
Lasă un comentariu Lasă un comentariu

Lasă un răspuns Anulează răspunsul

Adresa ta de e-mail nu va fi publicată. Câmpurile obligatorii sunt marcate *

Acest site folosește Akismet pentru a reduce spamul. Aflați cum sunt procesate datele comentariilor dvs.

Traducere

English中文(简体)DanskNederlandsFrançaisDeutschItaliano한국어PolskiPortuguêsRomânăEspañolУкраїнська
 Editați traducerea
de Transposh - translation plugin for wordpress

Postări populare

Cerințe de sistem pentru Windows Server 2016
Windows Server
Lista de colecție de interogări din Configuration Manager
Lista de colecție de interogări din Configuration Manager
ConfigMgr
Navigarea structurată/gestionată este activată în paginile moderne din site-urile clasice ale echipelor
Teh
SCCM nu s-a obținut locațiile DP ca versiune așteptată de la MP
ConfigMgr

Postări recente

Instalarea și configurarea Fail2ban pentru protecție SSH pe Ubuntu 24.04
Linux
Activarea și configurarea FirewallD pe AlmaLinux
Linux
Crearea utilizatorilor și configurarea cheii SSH în AlmaLinux
Linux
Cum să resetați parola pe AlmaLinux
Linux

© 2023 EnterinIT

Accesați versiunea mobilă
adbanner
Bine ai revenit!

Conectați-vă la contul dvs

Nume de utilizator sau adresă de e-mail
Parolă

Ți-ai pierdut parola?