3,244
社区成员




if ((Get-PSSnapin 'Microsoft.SharePoint.PowerShell' -ErrorAction SilentlyContinue) -eq $null){Add-PSSnapin 'Microsoft.SharePoint.PowerShell'}
$SPSiteFilter = "https://sharepoint.domain.ch"
Get-SPSite | where{$SPSiteFilter -contains $_.Url} | %{
$_.rootweb.siteusers | where{($_.DisplayName -ne $_.UserLogin) -and $_.IsDomainGroup} | %{
Write-Host "Change: $($_.DisplayName) to: $($_.UserLogin)"
$_.DisplayName = $_.UserLogin
$_.Name = $_.UserLogin
$_.Update()
}
}
reference