Git Product home page Git Product logo

poshevents's Introduction

PoShEvents

PowerShell Gallery Downloads PowerShell Gallery Version (including pre-releases)

The functions contained in this module will assist in harvesting data from event logs for various events.

Installing the Module

Install-Module -Name PoShEvents

Group Policy Processing Events

If you need to determine if a particular policy has applied to a user or computer, you can use the Get-GPOProcessingEvent function.

Get-GPOProcessingEvent -MaxEvents 10 | Out-GridView

This command will show the last 10 group policy processing events on the local system in gridview. You can then sort or enter additional criteria in the gridview.

Logon Failure Events

Logon failure events, those events with Ids of 4625 and 4771, can be found using the Get-LogonFailureEvent function.

Document Printing

The Get-PrintDocumentEvent function will show you all of the successful print jobs that the system has processed.

C:\PowerShell\Get-PrintDocumentEvent -ComputerName printsvc -MaxEvents 1 -Oldest

ComputerName      : PRINTSVR
TimeCreated       : 10/5/2017 8:12:05 AM
PrintJobId        : 234
DocumentName      : Print Document
UserName          : <user name>
ClientMachineName : <system name>
PrinterName       : <generic printer name>
PrinterPort       : IP_<printer IP>
DocumentSizeBytes : 1557928
DocumentPageCount : 2

Remote Desktop Connection Activity

Use Get-RemoteLogonEvent to show all remote desktop connections. [This function needs to be refactored to use Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational. Also, auditing would need to be enabled for this function to useful.]

Service Events

The Get-ServiceEvent function will query the specified system for all service control manager events for service operations, stop, and start events. You can then filter on a particular service name or service DisplayName.

PS C:\PowerShell\Temp> (Get-ServiceEvent).Where({$_.ServiceDisplayName -match "print"}) | Select-Object -Property TimeCreated,EventType,ServiceName,ServiceDisplayName,Message

TimeCreated        : 9/12/2017 9:41:27 PM
EventType          : ServiceOperations
ServiceName        :
ServiceDisplayName : Printer Extensions and Notifications
Message            : The Printer Extensions and Notifications service is marked as an interactive service.  However,
                     the system is configured to not allow interactive services.  This service may not function
                     properly.

TimeCreated        : 10/3/2017 10:42:18 PM
EventType          : ServiceOperations
ServiceName        : Spooler
ServiceDisplayName : Print Spooler
Message            : The start type of the Print Spooler service was changed from auto start to demand start.

TimeCreated        : 10/3/2017 10:42:20 PM
EventType          : ServiceOperations
ServiceName        : Spooler
ServiceDisplayName : Print Spooler
Message            : The start type of the Print Spooler service was changed from demand start to auto start.

System Restarts

You can quickly find out when a system was restarted and what process or user initiated the restart using the Get-SystemRestartEvent function.

Get-SystemRestartEvent -ComputerName DC1 -MaxEvents 10

poshevents's People

Contributors

thedavecarroll avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.