The Problem is “If a web application is using Windows
authentication and the site user directory path is not set, the People Picker
control searches all the Active Directory to resolve users' names or find
users, instead of searching only users in a particular organizational unit (OU).” Microsoft
TechNet site said.
Below is the PowerShell and stsadm commands to Retrieve Users from a Specific OU in Active Directory:
Get current user account directory path for all Site Collections in a Web Application:
Get-SPSite -Limit All | Select Url, UserAccountDirectoryPath
Get current service account directory path:
stsadm -o getproperty -url http://ServerName -pn
peoplepicker-serviceaccountdirectorypaths
Set service account directory path:
stsadm -o setproperty -url http://contosto -pn "peoplepicker-serviceaccountdirectorypaths" -pv "OU=Contoso-Admin,DC=Contoso,DC=com"
Configure settings for Web Application (All Site Collections in a Web Application):
$WebApp = "http://WebApp"
Get-SPWebApplication
$WebApp
|
Get-SPSite
-Limit
All
|ForEach-Object { Set-SPSite -Identity $_.Url -UserAccountDirectoryPath
"OU=Contoso-Users,DC=Contoso,DC=com" }
Configure settings
for a Site Collection:
Set-SPSite -Identity "http://Contoso/SiteCollection" -UserAccountDirectoryPath "OU=Contoso-Users,DC=Contoso,DC=com"
Restore Default settings for a Site Collection:
Useful links:
Set-SPSite -Identity "http://Contoso/SiteCollection" -UserAccountDirectoryPath ""
Useful links:
No comments:
Post a Comment