Archive for December, 2019

List users with passwordlastset as null

Sunday, December 22nd, 2019

Another test from the month of lunches book was to list out user account with passwordlastset as null.

get-aduser -filter * -properties passwordlastset | where {$_.passwordlastset -eq $null} | ft Name,PasswordLastSet

get-service show startup automatic and stopped

Sunday, December 22nd, 2019

Going through the learn powershell in 30 days. One test question was to display services with automattic startup and are stopped:

Get-Service | Select-Object -Property Name,Status,StartType | where-object {$_.Status -eq “Stopped” -and $_.StartType -eq “Automatic”}

Get-EventLog does not display retention dates

Monday, December 16th, 2019

A simple issue of trying to print the retention days for the logfiles.

The problem is the date does not print with the standard output column name.

You have to use the property MinimumRetentionDays

Lesson of the day? Always use the GM option.