![]() ![]() Write-Verbose "Modified DirectoryEntry that contains a newly formated adspath and passes in stored credentials" $DC = (("LDAP://OU=Domain Controllers,$($Root)").Children |ForEach-Object ) Write-Verbose "Cast the modified root, pointing at the Domain Controllers OU to get the first DC listed" $Root = $AdsPath.Substring(($AdsPath.ToLower().IndexOf('dc=')),$AdsPath.Length-($AdsPath.ToLower().IndexOf('dc='))) Write-Verbose "Pull out the root from the path" $AdsPath = 'LDAP://OU=Office3101,OU=BuildingA,OU=People,DC=company,DC=com' Write-Verbose "An LDAP Url for where you want to search" You would define your path to be the remote server and then you should be able to pass in alternate credentials with that. has a constructor class that allows you to pass in alternate credentials. I've used them and not had any problems with them, I also work with some folks who are The second would be more likely to work, but some folks have a problem using third party stuff on their servers so they would need to download and install quest tools. So you would need to assume that in order for your first one to work the domain on the other side is running AD web stuff which it may not be, so I think ![]() If I'm not mistaken, it sounds as if the OP would like to query AD potentially from a different forest.
0 Comments
Leave a Reply. |