brianlala / AutoSPInstaller

Automated SharePoint 2010/2013/2016/2019/SE PowerShell-based installation script.
https://autospinstaller.com
MIT License
171 stars 81 forks source link

Object Cache Accounts not passing validation #34

Open SpliceVW opened 5 years ago

SpliceVW commented 5 years ago

While in the initial step of validating all accounts used in my config XML, both of the object cache accounts (SuperUser and SuperReader) show "Invalid!" and the script halts. I've verified that the accounts exist, and are domain accounts.

I've tried adding them as managed accounts - which yields interesting results in that they're shown twice in validation, and show "Verified" for the managed account but "Invalid" for the object cache account.

SpliceVW commented 5 years ago

I think this may be due to the domain. The user is in the same domain as the computer, but not as the setup account (my account). It looks like the LDAP lookup for the object cache account validation is using the domain account of the user, not the computer or domain specified for the user in the XML. I fixed it in my scenario (not sure if this will work for everyone) by changing the function to: function userExists ([string]$name, [string]$domain) { ... $domainRoot = [ADSI][string]::Format("LDAP://{0}",$domain) ... }

brianlala commented 5 years ago

Thanks, if you feel this might be a permanent fix, feel free to submit a PR for review!

Cheers Brian