question

KushalGoswami-4671 avatar image
0 Votes"
KushalGoswami-4671 asked RichMatheisen-8856 commented

ADSI with Powershell

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered KushalGoswami-4671 commented

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".

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks , can you tell, where do I have to make this change ?

0 Votes 0 ·
Evgenij-Smirnov avatar image
0 Votes"
Evgenij-Smirnov answered RichMatheisen-8856 commented

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

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am just running a command

$ADSI = New-Object System.DirectoryServices.DirectoryEntry("LDAP://$OUPath", "username", "password")

0 Votes 0 ·

Without seeing what you're doing it's hard to say what isn't working.

Does this help at all: powershell-using-adsi-with-alternate.html


0 Votes 0 ·