This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
windows:windows_adinfo [2021/10/06 21:16] manu |
windows:windows_adinfo [2023/02/15 22:04] (current) manu |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Windows AD information in command line ====== | ====== Windows AD information in command line ====== | ||
| + | |||
| + | <cli prompt='>'> | ||
| + | C:\Users\myuser1>gpresult /r | find "OU" | ||
| + | CN=MYUSER1,OU=ALL Users,OU=NDS,DC=xxx,DC=xxx,DC=lu | ||
| + | GPOUSER_ScreenSaver30m | ||
| + | </cli> | ||
| + | |||
| + | List all groups of a user: | ||
| + | <cli prompt='>'> | ||
| + | C:\Users\myuser1> (GET-ADUSER –Identity myuser1 –Properties MemberOf | Select-Object MemberOf).MemberOf | ||
| + | </cli> | ||
| Get the extensionAttribute attribute value for all Active Directory users using PowerShell | Get the extensionAttribute attribute value for all Active Directory users using PowerShell | ||
| How do I return the sAMAccountName and a particular attribute – in this case extensionAttribute1 for all Active Directory users in PowerShell | How do I return the sAMAccountName and a particular attribute – in this case extensionAttribute1 for all Active Directory users in PowerShell | ||
| + | <cli prompt='>'> | ||
| + | Get-ADUser username -Properties * | Select * | ||
| + | </cli> | ||
| + | |||
| <cli prompt='>'> | <cli prompt='>'> | ||
| Get-ADUser -Properties extensionAttribute1 -Filter * | Select sAMAccountName, extensionAttribute1 | export-csv c:\temp\extensionattribute1.csv | Get-ADUser -Properties extensionAttribute1 -Filter * | Select sAMAccountName, extensionAttribute1 | export-csv c:\temp\extensionattribute1.csv | ||