Friday, May 25, 2012

ULS Viewer real-time feeds NOT working

I've had this issue in the Development VM I'm using, where ULS Viewer would never load the logs in real-time from the LOGS folder.

I ended up finding the issue, or at least a solution for my case, in some comments on the Microsoft tool page (here), which was deleting all the old log files. The current one will be in use and won't be deleted, which is fine.

Another workaround was deleting the upgrade*.log files only, but I didn't have any, so the problem was probably in another log file. It seems that if the logs that don't follow the  formatting ULS Viewer expects, RT feeds won't work correctly.

Saturday, May 12, 2012

Regain control of SQL Server

I started using a VM from a template someone else built in the last couple of days. My account was a local machine admin, but not a SQL Server admin. I actually had no access configured in SQL Server for my account. But I needed to get control over it and had no one available to help me in that moment.

In order to get sysadmin permissions on SQL Server, I did this:
  1. Shut down SQL Server Services
  2. Open a command line as Administrator
  3. Change to you SQL Server Binn dir
    • cd "c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn"
  4. Run SQL Server in single-user mode
    • sqlservr.exe -m -s MSSQLSERVER
  5. Open a new command line as Administrator
  6. Connect to SQL Server
    • sqlcmd -S .\ (or sqlcmd -S .\MSSQLSERVER)
  7.  Execute commands
    • 1> sp_addsrvrolemember 'domain\user', 'sysadmin'
    • 2> GO
  8. CTRL+C in both windows to exit sessions
  9. Restart SQL Server Services 
  10.  
    PS: You may need to be quick connecting to SQL (step 6) after starting it in single-user mode (step 4), otherwise some other process may pick up the session (remember, obviously, only one connection will be allowed...we're running in single-user mode!). Not a bad idea to have both command line windows open and ready to click Enter.

Tuesday, May 1, 2012

Unreliable Item Count in Search Scopes

Beware with the Item Count column present in Central Administration, in the Search Scope Properties and Rules interface, as it may not be accurate.

It does state it is "approximate", but what does it mean?

What happens is it queries the Search Service to get this Item Count, using the current logged on account (in Central Admin) which may or may not have permissions to see all the results. So the Item Count retrieved is actually the one pertaining the current logged user viewing this page, and not a global result.

This will be an issue in highly security trimmed contexts, where there is probably no account with access to the entire index (except for the crawler account). Therefore, the Item Count will be pretty much useless.

This design flaw in the Central Administration seems to be present since MOSS2007, as it can be seen here.