Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Retrieve Autodiscover SCP record from individual Domain Controllers

$
0
0

I'm looking to create a script to query individual Domain Controllers within an AD site. It's mostly going to be used for comparing the individual records from each Domain Controller within an a single AD site for Autodiscover.

I already have the records I'm attempting to locate:

Normal 0 false false false EN-US X-NONE X-NONE

'(&(objectClass=serviceConnectionPoint)(|(keywords=67661d7F-8FC4-4fa7-BFAC-E1D7794C1F68)(keywords=77378F46-2C66-4aa9-A6A6-3E7A48B19596)))'

 

But I'm not exactly sure how I can get it to pull from an individual Domain Controller.

Ideally I would like it to use a reference file where I can create a list of DC's to query and then output the results to either a CSV or a text file.

I'm getting conflicting ways on how to perform the query.

There is this: New-ObjectSystem.DirectoryServices.DirectorySearcher

Or as Ed Wilson of the "Hey Scripting Guy" blog recommends using [ADSISearcher]

Any help on which method would be better on completing the query would be appreciated.

 

I was able to find a starting point but I haven't had much luck getting this to work.

$ADDomain= Get-ADDomain| Select DistinguishedName
$DSSearch= New-ObjectSystem.DirectoryServices.DirectorySearcher
$DSSearch.Filter= '(&(objectClass=serviceConnectionPoint)(|(keywords=67661d7F-8FC4-4fa7-BFAC-E1D7794C1F68)(keywords=77378F46-2C66-4aa9-A6A6-3E7A48B19596)))'
$DSSearch.SearchRoot = 'LDAP://CN=Configuration,'+$ADDomain.DistinguishedName
$DSSearch.FindAll() |

I 've tried added $DSSearch.SearchScope = Subtree but haven't had much luck on getting a returned response so I'm sure I'm messing something up.

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles