Powershell error - Server instance not found on the given port.
i have ad backup opened in tcp port 5432
dsamain -dbpath ntds.dit -ldapport 5432 -allownosadminaccess
when use dsquery tool, can select localhost:5432 target using ds tools can information want
but when try use powershell commands -server;localhost:5432 got error:
server instance not found on given port.
using get-adobject ou get-aduser
ps c:\users\administrator> get-adobject -server localhost:5432 -filter 'objectclass -eq "user"'
get-adobject : server instance not found on given port.
@ line:1 char:13
+ get-adobject <<<< -server localhost:5432 -filter 'objectclass -eq "user"'
+ categoryinfo : invalidargument: (:) [get-adobject], argumentexception
+ fullyqualifiederrorid : server instance not found on given port.,microsoft.activedirectory.management.commands.getadobject
powershell cmdlets dont "speak pure ldap", communicate ad web services (and maybe encrypted). service runs on dc when can run posh command against (... -server <domain controller> ).
adws uses special port, neither ldap nor gc. dont know whether can tell adws use snapshot. i'd think no.
but work: connect snapshot using [adsi] , [adsidearcher] or corresponding .net classes. these classes can connect non-ad-ldap server.
$direntry = new-object system.directoryservices.directoryentry( "ldap://mydc.contoso.com:5432/dc=contoso,dc=com" )
see http://blogs.technet.com/b/heyscriptingguy/archive/2010/08/23/use-the-directorysearcher-net-class-and-powershell-to-search-active-directory.aspx or google around [adsi].
hth
walter
Windows Server > Directory Services
Comments
Post a Comment