ADSI with Powershell

Kushal Goswami 21 Reputation points
2021-07-12T09:42:42.02+00:00

Hello, I have been trying to do ADSI binding with Powershell on domain joined PC with local account login, and passing the domain credentials it is just failing with

"Exception occurred while retriving member "distinguishedName" : The specified domain is either does not exists or could not be contacted"

Its does work, all good, when I do this with AD account login and passing other AD credentials.

Machine is connected to LAB and domain is pinging, no issues there.

Please can someone help, how do I achieve this.

Thank you for the help.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,359 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Rich Matheisen 44,776 Reputation points
    2021-07-12T14:46:10.213+00:00

    Which groups have permission to read data from the AD?

    Since you're using non-domain credentials you'd probably have to allow Guest access. "Authenticated users" can read data from the AD. "Everyone" includes "Guest" (and "Guest" is disabled by default) and "Authenticated Users". "Anonymous" logins are excluded from "Everyone".


  2. Evgenij Smirnov 541 Reputation points
    2021-07-12T15:06:24.517+00:00

    How about you post some code so we can help you figure out where it doesn't work as intended?