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

Commented Issue: Account invalid (SuperReader, SuperUser) [20601]

$
0
0
If the SuperReader and SuperUser Account exist in another domain, these accounts are marked as invalid. The problem is caused by the method:

function userExists ([string]$name)

In my view this function should use a domain parameter to work properly.
Comments: ** Comment from web user: KevinColeMCM **

I also had this issue where the server was on DOMAINA and user accounts were on DOMAINB

The option I used instead however was to create an entry in the autospinstallerconfig.xml and modify the functions so that an LDAP path is passed into the user exists method if it is provided in the config file.


Updated userExists function to accept ldap option for override:
```
# ====================================================================================
# Func: userExists
# Desc: "Here is a little powershell function I made to see check if specific active directory users exists or not."
# From: http://oyvindnilsen.com/powershell-function-to-check-if-active-directory-users-exists/
# ====================================================================================
function userExists ([string]$name, [string]$ldap)
{
#written by: Øyvind Nilsen (oyvindnilsen.com)
[bool]$ret = $false #return variable
$domainRoot = [ADSI]"$ldap"
$dirSearcher = New-Object System.DirectoryServices.DirectorySearcher($domainRoot)
$dirSearcher.filter = "(&(objectClass=user)(sAMAccountName=$name))"
$results = $dirSearcher.findall()
if ($results.Count -gt 0) #if a user object is found, that means the user exists.
{
$ret = $true
}
return $ret
}
```

Updated foreach block in AutoSPInstallerFunctions.ps1 :: ValidateCredentials
```
foreach ($account in $accountsToCheck)
{
$domain,$accountName = $account -split "\\"
Write-Host -ForegroundColor White " - Account `"$account`"..." -NoNewline
if (!(userExists $accountName -ldap $xmlinput.Configuration.Farm.CustomLdap))
{
Write-Host -BackgroundColor Red -ForegroundColor Black "Invalid!"
$acctInvalid = $true
}
else
{
Write-Host -ForegroundColor Black -BackgroundColor Green "Verified."
}
}
```

Added under <Farm> element into config xml:
```
<Configuration Environment="PILOT" Version="3.99.60">
<Farm>
<CustomLdap>LDAP://DC=LAN,DC=local</CustomLdap>
</Farm>
</Configuration>
```



Viewing all articles
Browse latest Browse all 2279

Trending Articles



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