September 2010
M T W T F S S
« Aug    
 12345
6789101112
13141516171819
20212223242526
27282930  

Author Archive for Chris Auer

23
Aug

Truncate log file in 2008 (no backup)

 use [WSS_Content]

select * FROM sys.database_files

ALTER DATABASE [WSS_Content] SET RECOVERY SIMPLE WITH NO_WAIT

DBCC SHRINKFILE(WSS_Content_log, 1)

ALTER DATABASE [WSS_Content] SET RECOVERY FULL WITH NO_WAIT

11
Dec

Hide all the SharePoint goodies when in anonymous mode

When you are in anonymous mode, published, you dont want any of the SharePoint scripts to be running like named.dll. The way to hide it is to wrapped the SharePoint scripts in a security tab. Thus security trimming the scripts and SharePoint overriding CSS classes.

 

<Sharepoint:SPSecurityTrimmedControl PermissionsString=”BrowseDirectories” runat=”server”>
  <!–showing sharepoint scripts –>
  <SharePoint:ScriptLink name=”init.js” runat=”server”/>
  <Sharepoint:CssLink runat=”server”/>
</Sharepoint:SPSecurityTrimmedControl>

24
Jul

This product requires ASP.NET v2.0 to be set to ‘Allow’ in the list of IIS Web Server Extensions

I think there might be an issue with .NET 2.0 SP2 that causes my normal fix of “click the reinstall button on .NET 2.0″ to fix this issue. i recently ran into this issue again and it didnt work. What did work is the commands below. Bascially it is uninstalling and reinstalling via regiis.

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -u   (uninstall)

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -i   (reinstall)

08
Jul

the search service is currently offline. visit the services on server page in sharepoint central administration to verify whether the service is enabled. this might also be because an indexer move is in progress

Why did this happen? No idea. How did I fix it, read below.

  1. Open central admin
  2. Goto Operations
  3. Goto Services on server and located your index server
  4. On “Office SharePoint Server Search” click “Stop”. This deconfigures it.
  5. Now click “start”
  6. Then click “Shared Services Administration”, hover over the failing SSP and select edit.
  7. You will notice now the indexer is not selected. Select it from the drop down.
  8. HERE IS THE IMPORTANT PART. The server you have selected is probably the same server as you used before. If it is, go to that server and locate the indexer files. It is in the textbox right below the drop down you just used. For me it was “F:\Program Files\Microsoft Office Servers\12.0\Data\Office Server\Applications”. In there you will find a folder with Guid name. At the end of that folder add “_old”. Now go back to your SSP and click OK. Wait 1 minute and the index will recreate the guid folder.
  9. Tada, all fixed.
08
Jul

Remove hiberfil.sys on Server 2008

For what ever reason server 2008 creates a file on the OS drive for hybrinating the same size as the RAM that is in the server. Not sure how many servers hybrinate, but not mine.

To turn it off just run this from command line

powercfg -h off

Enjoy.

19
May

Disable Roaming Profiles In GPO

Open you local GPO using MMC or using the GPO editor in your AD. Then enable “Only allow local user profiles” in Computer Config -> Administrative Templates -> System -> User Profiles

If you completly want to disable roaming profiles on your Terminal Server
you also have to enable “Prevent Roaming Profile changes from propagating to
the server”.

11
May

Force a truncation of a SQL log

I ran into an issue recently with a log file that would not shrink. All the DB Truncates that I ran would not shrink it. The fix is to just detach the DB, rename the log file and reattach. That will create a new log file from scratch.

Detail are here

sp_detach_db [YourDatabaseName]

then

sp_attach_db @dbname = N‘YourDatabaseName’,
@filename1 = N‘D:\Microsoft SQL Server1\MSSQL\Data\YourDatabaseName.MDF’

07
May

Access denied on search crawl for SharePoint 2007

I have no idea why, but more and more I am seeing search crawls result in error of “access is denied”. The issue is that the web server is not allowing authentication to sites that are localhost (or local). The fix is simple, but I wish I knew why this was creeping up more.

Fix is here

In short do the follow. The reboot is necessary.

Method 2: Disable the loopback check

Follow these steps:

  1. Click Start, click Run, type regedit, and then click OK.
  2. In Registry Editor, locate and then click the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  3. Right-click Lsa, point to New, and then click DWORD Value.
  4. Type DisableLoopbackCheck, and then press ENTER.
  5. Right-click DisableLoopbackCheck, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Quit Registry Editor, and then restart your computer.
30
Apr

Register .NET user for an App Pool

Sometime in a non AD environment you need a user to run an App Pool so you can do cross server work (i.e. SQL). Before you can use the user in the App Pool identity you have to tell ASP.NET that they should be allow to run ASP.NET.

Simple command to run from the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 directory

aspnet_regiis.exe –ga [UserName]

 

This will tell ASP.NET to allow this user to access temp directories and the assembly code.

23
Mar

User cannot be found

User cannot be found.   at Microsoft.SharePoint.SPUserCollection.GetByID(Int32 id)
   at Microsoft.SharePoint.Publishing.CommonUtilities.LookUpUser(SPWeb web, String userLookupValue)
   at Microsoft.SharePoint.Publishing.CommonUtilities.GetUserFieldValue(SPListItem item, Guid fieldId)
   at Microsoft.SharePoint.Publishing.PublishingPage.get_Contact()
   at Microsoft.SharePoint.Publishing.Internal.CodeBehind.PageSettingsPage.LoadValues()
   at Microsoft.SharePoint.Publishing.Internal.CodeBehind.BasePageSettingsPage.OnLoad(EventArgs e)
   at Microsoft.SharePoint.Publishing.Internal.CodeBehind.PageSettingsPage.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

An odd thing can happened in SharePoint. If you add a user named Joe Smith to a server, then add that user to SharePoint. Later you need to completely remove that user. So you delete the user from the server and you completely remove the user from sharepoint. (removed them from the user collection, not just the site)

One day comes and low and behold you need to add Joe Smith to the server again. You create a new user account for Joe on the server and add Joe to SharePoint. The only issue is that SharePoint doesnt resurrect the user from SharePoint. It creates a new one. And now when you are in a page that was originally created by the 1st Joe Smith you get the error above. Yippy.

If you run the SQL below you will find the two Joe Smith accounts.

SELECT * FROM UserInfo WHERE tp_Login = ‘MYSERVER\Joe.Smith’

You will get results like this

 

No User SQL

No User SQL

 The field tp_ID is the SharePoint UserID. The field sp_Deleted tells SharePoint if the user has been deleted. When you manually flag a user as deleted, all you have to do is to put the user’s ID in the tp_Deleted field. Notice that the user 19 has 19 in the tp_Deleted field.

So to resurrect the user 19 I need to kill user 16 since they both have the same username. The way I do that is simple

UPDATE UserInfo SET tp_Deleted = 16 WHERE tp_ID = ‘16′
UPDATE UserInfo SET tp_Deleted = 0 WHERE tp_ID = ‘19′
 

The SQL above will set user 16 to deleted by adding 16 to their tp_Deleted field. Changing user 19’s tp_Deleted field to 19 makes them active and all pages will work when you try and view page properties.

 

 

 

 

I hope this help anyone who runs into the same issue. I was a pain to try and diagnose why it wouldnt work and I think there is a fix for it coming from MS. But this server is on SP1 and it still does it.
NOTE: This sinerio will work if you just delete a user from SharePoint completely and need to edit their pages. Just put a "0" in the tp_deleted.