Monitoring remote connections

I am doing research to tighten security. Is there a preferred way to monitor and log PSRemote connections to servers and workstations? 

No Data
  • This depends on what OS and PowerShell version are deployed in your environment.
    On Windows Server latest versions, you can set this Group Policy.
    On earlier versions it's a bit more of a challenge.

    There is per module logging, locally enabled this way, at the PowerShell ISE, PowerShell console host.

    Import-Module -Name ActiveDirectory
    (Get-Module ActiveDirectory).LogPipelineExecutionDetails = $true

    Running AD commands get logged to the PowerShell Event log.

    Open Event Viewer from the Tools menu in Server Manager and expand
    Applications and Services Log, Microsoft, Windows, and PowerShell, then select
    the Operational log.

    GPO (local machine or domain-wide) settings.
    Enter the modules you want log info on

    On Domain Controller or local machines you can use the Group Policy Editor as well to set settings.

    Computer Configuration >
    Administrative Templates >
    Windows Components >
    Windows PowerShell

    Here you'll find 5 options

    Turn On Module
    Turn On PowerShell Script Block Logging
    Turn On Script Execution
    Turn On PowerShell Transcription
    Set the default source path for Update-Help

    Enable what you wish.

    At a minimum for this list,

    Turn On Module logging with these settings...



    Turn On PowerShell Script Block Logging
    Turn On PowerShell Transcription

    You can actually set a specific remote UNC path for all transcript files but you have
    to ensure it is always available, or user using cmdlets / scripts will have

    Otherwise, you allow it to log on each local machine and use a nother script
    or tool to collect logs to a central server for your to review.

    Here is a set of articles on the topic, Ive shared with others to date:

    PowerShell Security at Enterprise Customers

    PowerShell ♥ the Blue Team

    Practical PowerShell Security: Enable Auditing and Logging with DSC

    PowerShell Security: PowerShell Attack Tools, Mitigation, & Detection

    Investigating PowerShell: Command and Script Logging

    Greater Visibility Through PowerShell Logging

    More New Stuff in PowerShell V5: Extra PowerShell Auditing

No Data