white-turtle

web-space of - vishal basra

turtles and code!


AD users PS

This post is a hack for when i have to be quick and dirty

How to list users and get details

# more details
Get-ADUser -Filter 'Name -like "*basra*"' -Properties *

# less details
Get-ADUser -Filter 'Name -like "*basra*"'

See also Docs

See also CMD-let

Gow to reset a password ( force )

This is a bad method, but may be quick and of use when you know what you’re doing

Set-ADAccountPassword 'CN=Vishal Basra,OU=Infrastructure,OU=Users,DC=white-turtle,DC=org' -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "I am an awesomeP@sswor45" -Force)

#syntax
Set-ADAccountPassword '<Distinguished Name>' <options>

# note that the 'force' is needed for the plain-text password

# please see a better way of doing it in the link below

See also CMD-let


vishal@white-turtle.org