Powershell

The PowerShell script is designed to extract information about Remote Desktop Protocol (RDP) local session manager events from the Windows event logs on a RDS host and save it to a CSV file. Script: Get events with EventID 40 from Microsoft-Windows-TerminalServices-LocalSessionManager/Operational Event Log $RDPAuths = Get-WinEvent -LogName ‘Microsoft-Windows-TerminalServices-LocalSessionManager/Operational’-FilterXPath ‘<QueryList><Query Id=”0″><Select>*[System[EventID=40]]</Select></Query></QueryList>’ [xml[]]$xml = $RDPAuths | ForEach-Object…

Read More Analyze RDP Disconnection Logs using PowerShell

Working with some older Cisco ASA devices, I’m trying to access the ASDM interface. The browser isn’t giving me luck, so I turned to PowerShell to help me, but I get the following error when trying an Invoke-WebRequest to grab the asdm.jnlp file I need. The underlying connection was closed: Could not establish trust relationship for the…

Read More Could not establish trust relationship for the SSL/TLS secure channel.

This PowerShell script retrieves information about enabled Active Directory (AD) users, including their SAM account name, last logon time, and organizational unit (OU). The script makes use of several cmdlets and concepts that are common in PowerShell, including filtering, selecting, sorting, and transforming data. Get-ADUser -Filter * -Properties lastLogon | Where-Object { $_.Enabled -eq $True…

Read More Get Enabled AD Users with Last Logon Time and Organizational Unit Information