Category: Active Directory

List all Local Accounts on a Server Copy the following Below into text pad and save as a .ps1, run script accordingly. Update network path if required. Echo “Input computer name: ” $Computer = Read-Host $Credential = Get-Credential Get-WmiObject -Class Win32_UserAccount -Filter  “LocalAccount=’True’” | Select PSComputername, Name, Status, Disabled, AccountType, Lockout, PasswordRequired, PasswordChangeable, SID | […]

Read more

Disabled Users with LastLogOnDate and OU Structure Copy the Script below it will produce an output file with the results where you have ran the script, you can add a network path if preferred. Script will show Disabled accounts with Last login Date and location of the account. Echo “Input computer name: ” $Computer = […]

Read more

Very small and basic script that pulls last logon times. Copy the code and save as a .ps1 “Get-ADUser -Filter * -Properties * | Select-Object Name, @{Name=”Last Successful Logon”;Expression={[datetime]::FromFileTime($_.’lastLogonTimeStamp’)}} | Sort-Object “Last Successful Logon””  

Read more