Posts

Showing posts from 2009

Upload documents to document library in MOSS from a asp.net web site and change Content Type.

I wasworking on a requirement that lets the users upload documents to a MOSS document library from a asp.net site. The web site is installed on a seperate server from the MOSS server. To acheive this, i am using the http:// /_vti_bin /copy.asmx web service to upload the file. There is a custom workflow attached to document library that picks the documents and processes them. The problem that i faced was that i needed to be able to change the content type of the document(the document library has multiple content types) before it is processed by the workflow. After finding out how easy it is, i was kicking myself(rightly so) for missing such an easy thing.   Basically the ContentType field is of Type "Choice", so you have to add a field of type "Choice" in your code and your are done. What is strange is that quite a number of people do not know about this and propose doing this using FrontPage RPC calls (ouch..in terms of the effort) or updating the content type afte...

Database Trend Analysis.

A common question that a DBA gets asked is to find out the what is the database growth like. A easy way to get this is run the query below  select database_Name, backup_start_date, backup_size, ((backup_size/1024.0)/1024.0)/1024.0 'Size In GB'  from Msdb.dbo.backupset where database_name = 'MyDatabase' and type = 'D' order by Backup_start_date this database query will give you the size of the backup sets, which then sets the stage to do a proper trend analysis on the databases. Happy coding.

Duplicate Site Error In MOSS

Recently we had to move the content databases for MOSS. once we had sucessfylly moved the databases over, we started to see the errors(See blow) in the Applicaton log Event ID: 7888 Task Category: Office Server General Source: Office SharePoint Server A runtime exception was detected. Details follow. Message: A duplicate site ID 53e40665-62d0-4316-9192-4d65f247a9a4(http://moss) was found. This might be caused by restoring a content database from one server farm into a different server farm without first removing the original database and then running stsadm -o preparetomove. If this is the cause, the stsadm -o preparetomove command can be used with the -OldContentDB command line option to resolve this issue. Techinal Details: Microsoft.Office.Server.UserProfiles.ProfileSynchronizationDuplicateSiteIDException: A duplicate site ID 53e40665-62d0-4316-9192-4d65f247a9a4(http://moss) was found. This might be caused by restoring a content database from one server farm into a different serv...

Implement Forms Auth in MOSS.

To save everyone else the potential HOURS of searching trying to figure out why I couldn't get the machineKey section from the web.config for a WSS 3.0 site it turns out that the IUSR_* account does not have read access to the web.config. Once read permissions were granted to the web.config all was fine. Typically this is not an issue but I changed the site to use forms authentication with a custom membership and role provider. Doing this required reading the machineKey from the web.config to encrypt the password. Since the IUSR*_ account was now the default identity and it didn't have read access to the web.config the login would fail and no errors were logged or reported anywhere. It is worth noting that when you have issues in your membership and/or role provider it can be difficult to track down the error since it isn't always logged for some reason. Also, just because it works in a stand alone web application doesn't mean it will work in WSS 3.0 since by defau...

Changed Datetime in Procedures.

Why does not SQL Server display the date and time a procedure was last changed? i have run into this issue many times and use the script below to get the changed date for the procedures in SQL. you can change the value in the [Type] to get results for different objects in SQL. select * from sys.objects where [type] = 'P' and modify_date >= '05/01/2009'

Logon Trigger

one of the great things i like about SQL 2005 is the implementation of the logon trigger. we have implemented at one of our clients which helps us track both sucessfull and unsucessfull logins. below is the script that i have used(given to me by Robert Djabrov). be sure that you have SQL 2005 SP2 along with the cumulative hotfix CU7 of SQL 2005 SP2. /* *************************************************************************** The script below creates all necessary objects to establish capability of capturing LOGON events against the instance where the script will be run. To check the last 100 LOGON events, pass 110 to the stored procedure, e.g.: exec msdb.dbo.sp__logon_tracker 100 To display all events, do not pass any parameter, and it will return the last 2,100,000,000 records (2.1 billion). ****************************************************************************/ use msdb go if object_id('msdb.dbo.__logon_tracker') is not null drop table msdb.dbo.__...

My Very first Blog

This is my very first blog..stay posted for more....