Door deze site te gebruiken, u gaat akkoord met de Privacybeleid.
Accepteren
OndernemingOndernemingOnderneming
  • THUIS
  • IT-PRO
  • Technisch
  • Microsoft
    • Azuur
    • Configmgr/sccm
    • DPM
    • Orkestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Kantoor 365
    • Kantoor insider
    • PowerBI
    • Skypen
    • SQL-server
    • Teams
  • VENSTERS
    • Windows-beheercentrum
    • Windows-client
    • Windows-server
  • SCCM-queryverzamelingslijst
Lezing: PowerShell Export remote PC event logs to local PC
Lettergrootte wijzigenAa
OndernemingOnderneming
Lettergrootte wijzigenAa
  • THUIS
  • IT-PRO
  • Technisch
  • Microsoft
  • VENSTERS
  • SCCM-queryverzamelingslijst
Zoekopdracht
  • THUIS
  • IT-PRO
  • Technisch
  • Microsoft
    • Azuur
    • Configmgr/sccm
    • DPM
    • Orkestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Kantoor 365
    • Kantoor insider
    • PowerBI
    • Skypen
    • SQL-server
    • Teams
  • VENSTERS
    • Windows-beheercentrum
    • Windows-client
    • Windows-server
  • SCCM-queryverzamelingslijst
Het pro

PowerShell Export remote PC event logs to local PC

Gepubliceerd: Februari 12, 2024
3 Min. gelezen
DEEL

PowerShell Export remote PC event logs to local PC.

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

OPMERKING: 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 met de NetBIOS name of the PC you want to connect to and extract the logs from. De “start notepad” command should then open the log file on your PC to review. Also, 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

GETAGD:PowershellRamenRamen 10
Vorig artikel DPM Delete a specific Recovery Point
Volgend artikel Power BI Desktop June 2019 Update
Laat een reactie achter Laat een reactie achter

Laat een antwoord achter Antwoord annuleren

Uw e-mailadres wordt niet gepubliceerd. Verplichte velden zijn gemarkeerd *

Deze site gebruikt Akismet om spam te verminderen. Ontdek hoe uw reactiegegevens worden verwerkt.

Vertaling

English中文(简体)DanskNederlandsFrançaisDeutschItaliano한국어PolskiPortuguêsRomânăEspañolУкраїнська
door Transposh - Vertaalplugin voor Wordpress

Populaire berichten

Systeemvereisten voor Windows Server 2016
Windows-server
Configuration Manager Queryverzamelingslijst
Configuration Manager Queryverzamelingslijst
ConfiguratieMgr
Gestructureerde/beheerde navigatie ingeschakeld op moderne pagina's in klassieke teamsites
Technologie
SCCM Kan DP-locaties niet ophalen als de verwachte versie van MP
ConfiguratieMgr

Recente berichten

Fail2ban installeren en configureren voor SSH-bescherming op Ubuntu 24.04
Linux
FirewallD inschakelen en configureren op AlmaLinux
Linux
Gebruikers aanmaken en SSH-sleutel instellen in AlmaLinux
Linux
Hoe het wachtwoord op AlmaLinux opnieuw in te stellen
Linux

© 2023 Onderneming

Ga naar mobiele versie
Welkom terug!

Log in op uw account

Gebruikersnaam of e-mailadres
Wachtwoord

Wachtwoord vergeten?