Cleare userprofile info

$Site = Get-SPSite http://wtcsps99:27841 $ServiceContext = Get-SPServiceContext($Site) $ProfileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext) $Profiles = $ProfileManager.GetEnumerator()  

$AccountName = $profile[[Microsoft.Office.Server.UserProfiles.PropertyConstants]::AccountName].Value  Foreach($oUser in $Profiles){

 $ProfileManager.RemoveUserProfile($oUser.item("AccountName")); }

$UPA = Get-SPServiceApplication | ? {$_.typeName -like '*User Profile*'} $UPA.NetBIOSDomainNamesEnabled $UPA.NetBIOSDomainNamesEnabled = $true $UPA.Update() $UPA = Get-SPServiceApplication | ? {$_.typeName -like '*User Profile*'} $UPA.NetBIOSDomainNamesEnabled

 

or

you can remove the user profile application and delete the data ,readd the application

 

posted @ 2014-04-15 16:44  Jason.Bird  阅读(220)  评论(0编辑  收藏  举报