Tag Archives: powershell

Querying Active Directory with PowerShell

First run the following command as administrator to make Get-ADUser command work:

Get-WindowsCapability -Online | Where-Object {$_.Name -like "*ActiveDirectory.DS-LDS*"} | Add-WindowsCapability -Online
Path          :
Online        : True
RestartNeeded : False

Try the following commands:

$ad_ip = "10.15.7.15"
$ad_user = "administrator@itdrde.local"
Get-ADUser -Server $ad_ip -Credential $ad_user -Properties *
(more…)