Powershell page 1 of 1 for 3 posts

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 SSL/TLS secure channel. Eh, ok. My first thought was to somehow avoid a certificate check but I did not see a native way of doing this with Invoke-WebRequest Continue Reading...

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

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 } | Select-Object samaccountname, @{ Name="lastLogon"; Expression={[datetime]::FromFileTime($_.lastLogon)} Continue Reading...

Check Windows Servers Activation Status

I needed a quick way to check activation status of Windows Servers in a domain. This is the solution I came up with using PowerShell to run the slmgr.vbs script for output. I'm not great with PowerShell, and I'm sure this can be cleaned up or made more efficient, but this 'hack' worked for me. $computers = get-adcomputer -filter "OperatingSystem -Like '*Windows Server*' -and Enabled -eq 'True'" | select-object name foreach($computer in $computers) { write-host $computer.name Invoke-Command Continue Reading...