Users PS

#PowerShell

Get-ADUser -Filter *

Get-ADUser -Filter * | where {$_.givenname -eq "testadmin"}

get-aduser -filter 'samaccountname -like "testadmin"'

#List all attributes

Get-ADUser -Filter * -Properties * |select -First 1 | Get-Member -MemberType *property | select name

Get-ADUser -Filter * -Properties * | where {$_.givenname -eq "testadmin"} | select sid, PasswordLastSet,PasswordExpired

Get-ADUser -Filter * -Properties * | where {$.givenname -eq "testadmin"} | select sid, PasswordLastSet,PasswordExpired, @{expression={[datetime]::FromFileTime($.pwdlastset)}}

#Get users details swap out -properties for *

Get-ADUser -Filter * -Properties PasswordLastSet,logoncount,description |Select-Object name,passwordlastset,logoncount, description

Get-ADUser -filter 'Description -like "built"' -Properties description

#Get Admin Count

Get-ADUser -filter 'samaccountname -like "*"' -prop samaccountname, admincount | where {$_.admincount -eq "1"}

#Get access list

(get-acl 'AD:\CN=testadmin,OU=TESTOrg,DC=Trg,DC=LOC').access

#Pre-Authentication

Get-ADUser -Filter {DoesNotRequirePreAuth -eq $true} -Properties DoesNotRequirePreAuth

Last updated