Sdílet prostřednictvím


After adding a "file://" link to My Links you will not be able to access the My Links page

You can try this out:
1.  Go to a SharePoint site (from a farm where you have My Links)
2.  Go then to "My links > Manage Links"
3.  On the MyQuickLinks.aspx page, click “Add Link”
4.  Here, put a link like file://<sharedLocation>/<filename> and press “OK”
5.  After the steps above you will not be able to access the list any more
 The only way I found to solve this issue (by now) is to delete that entry. Now, how can we do it.
I have created a small script that could help in this situation. It contains actually two parts:
- display the available links (so we would be able to identify it)
- delete a link we specify
 
The script is created in PowerShell, you will need to install it on your MOSS server.
 
First one: ListLinks.ps1
 
[void][reflection.assembly]::Loadwithpartialname("Microsoft.SharePoint") | out-null
[void][reflection.assembly]::Loadwithpartialname("Microsoft.Office.Server.Search") | out-null
[void][reflection.assembly]::Loadwithpartialname("Microsoft.Office.Server") | out-null

$servercontext=[Microsoft.Office.Server.ServerContext]::Default
$profilemanager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($servercontext)
$profile = $profilemanager.GetUserProfile("domain\user")
$qlinkmanager = new-object Microsoft.Office.Server.UserProfiles.QuickLinkManager($profile)
foreach ($link in $qlinkmanager.GetItems())
{
Write-Host $link.id " " $link.Url
}
Write-Host "Done"
 
The second one will delete the link we specify
 
[void][reflection.assembly]::Loadwithpartialname("Microsoft.SharePoint") | out-null
[void][reflection.assembly]::Loadwithpartialname("Microsoft.Office.Server.Search") | out-null
[void][reflection.assembly]::Loadwithpartialname("Microsoft.Office.Server") | out-null

$id = 214
$servercontext=[Microsoft.Office.Server.ServerContext]::Default
$profilemanager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($servercontext)
$profile = $profilemanager.GetUserProfile("domain\user")
$qlinkmanager = new-object Microsoft.Office.Server.UserProfiles.QuickLinkManager($profile)
foreach ($link in $qlinkmanager.GetItems())
{
if ($link.id -eq $id)
{
$link.Delete()
break
}
}
Write-Host "Done"