Quantcast
Channel: AutoSPInstaller
Viewing all articles
Browse latest Browse all 2279

New Post: Check Accounts fail in Trust Domain Scenario

$
0
0
I recently needed to install SharePoint in a scenario where I was installing in a LAB domain under while logged in to an account that was from a trusted domain. Note: ALL accounts for SharePoint where in the LAB domain. It appears that in this scenario, the following does not work to validate the accounts
$currentDomain = "LDAP://" + ([ADSI]"").distinguishedName
To get around this, I added a new Helper function
# ===================================================================================
# Func: GetLDAPDistingushedNameFromDomainName
# Desc: Return the correct LDAP distingushed name from the Friendly Domain Name
# ===================================================================================
Function GetLDAPDistingushedNameFromDomainName($friendlyDomainName)
{       
    $myRootDirContext = New-Object System.DirectoryServices.ActiveDirectory.DirectoryContext('domain', $friendlyDomainName)
    $myRootDomain = [System.DirectoryServices.ActiveDirectory.Domain]::GetDomain([System.DirectoryServices.ActiveDirectory.DirectoryContext]$myRootDirContext)

    Return $myRootDomain.Name
}
and then used it like this
$domain, $userName = $user -split "\\"
            
$currentDomain = "LDAP://" + (GetLDAPDistingushedNameFromDomainName($domain))
Any interest in moving this into the main code branch?

Viewing all articles
Browse latest Browse all 2279

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>