Can I query AD from a client computer in the domain using Powershell?
I can confirm from personal experience that you can, as long as you are a domain administrator. Before running cmdlets related to AD, you'll need to import the Active Directory module in your Powershell session. The cmdlet is simply
Import-Module ActiveDirectory
Once you've done that, you can run cmdlets like Get-ADUser, Unlock-ADAccount, etc.
Related videos on Youtube
Jericho
I work in the IT department and have inherited a suite of applications from various vendors in which I am required to be the expert of. From SQL, Exchange, VMWare, XenServer and more, this is the crown I bear and I will bring my findings to the stack community to form this synergistic relationship.
Updated on September 18, 2022Comments
-
Jericho over 1 year
I have a DC (windows server 2008 r2) that I want to run some Powershell queries against AD. Powershell ISE is not installed on any of the DCs. Is it possible to install Powershell ISE locally on my workstation (windows 7) and then point it to the DC to query AD?
-
Ben N over 8 yearsAt the moment, this post is essentially only a link. To make sure the answer remains useful even if the link breaks, please edit it to include the relevant information. (Your answer was discovered in an effort to repair or remove link-only answers.)
-
BeowulfNode42 almost 5 yearsFor this to work you will need the Remote Server Administration Tools (RSAT) installed on the client PC. For Windows 7 microsoft.com/en-US/download/details.aspx?id=7887 or on Windows 10 1809 or newer you need to install from the feature on demand "Add Feature" part of settings, 1 component at a time, or use a powershell command like
Get-WindowsCapability -Online | foreach {$_.Name -like "*RSAT*" -and $_.State -eq "NotPresent"} | Add-WindowsCapability -Online
to install all of them. -
Charles Burge almost 5 yearsThanks for pointing that out. It's been so long, I forgot about that part.