Wednesday, 24 July 2013

Conversion job settings cannot be changed after items have been added to the job in word automation services in Sharepoint 2013

Hi,

An issue was reported to me where an exception was coming while my admins were trying to use word automation services to convert some word documents in pdf format. They were constantly facing with this exception :

System.InvalidOperationException was unhandled
  HResult=-2146233079
  Message=Conversion job settings cannot be changed after items have been added to the job.
  Source=Microsoft.Office.Word.Server
  StackTrace:
       at Microsoft.Office.Word.Server.Conversions.ConversionJobSettings.set_OutputFormat(SaveFormat value)
       at WordAutomationService.Program.Main(String[] args) in
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

After reviewing the source code I found following:

                    cJob.AddLibrary(sourceList, destList);
                    ConversionJobSettings settings = rahulJOb.Settings;
                    settings.OutputFormat = SaveFormat.PDF;
                     cJob.Start();
In the highlighted lines it is evident that the job settings were tried to modified after adding source and destination document libraries. The code was modified and the highlighted lines were moved above the
cJob.AddLibrary(sourceList, destList) and the issue was confirmed to be resolved.

I hope this will help you out.

Thanks,
Rahul Rashu

Monday, 17 June 2013

The SDDL string contains an invalid sid or a sid that cannot be translated in Sharepoint 2013

Hi All,

Recently an issue was reported to me where some of my site admins were facing an issue in setting up a sharepoint 2013 stand alone environment. They were facing this error in the step 8 of sharepoint configuration wizard "The SDDL string contains an invalid sid or a sid that cannot be translated".

After spending significant amount of time this issue was finally resolved in this way:

1. Add the account you want to use for search service in WSS_Admin_WPG group. If you are going to use built in administrator account this should be present by default.
2. Then execute this command from sharepoint powershell console:
$SearchService = Get-Credential Domain\UserName

in our scenario o standalone installation the Domain should be the machine name.
3. Then execute this command
New-SPManagedAccount -Credential $SearchService
4. Now Go to "C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server" and find the folder that starts with Analytics with a postfix guid.
5. Right-click --> Properties-->Sharing-->Advanced Sharing
6. Check the "Share this folder' check box and click on Permissions
7. Add the Search Service account created in step 2 and select Full Control. Do the same for WSS_ADMIN_WPG
8. Run the SharePoint Configuration Wizard again. It should now complete successfully.

Thanks,
Rahul Rashu

Sunday, 13 January 2013

Unable to find Visio Graphics Proxy Service Application Proxy associated with this site in Sharepoint

Hi,

I have been reported an issue with Visio Services under the sites in one of the web application.
It was throwing an error "Unable to find Visio Graphics Proxy Service Application Proxy associated with this site".

After some troubleshooting I managed to fix this problem and here are the steps followed by me:
1. Open Central Administrator.
2. Go to Application Management-->Configure Service Application Associations.
3. Here add the Visio Graphics Service application proxy under Application Proxies for the concerned web application.
4. Click on Custom on next to your web Application and select the Visio Graphics Application.


That's it and it worked.
I hope this will help you out.

Thanks,
Rahul Rashu

Sunday, 30 December 2012

Visio Web Access is not available on this site

Hi,

An issue was reported to me where some of my site administrators were unable to use Visio web access webparts after configuring Visio Graphics service application in central administrator. After adding the Visio web access webpart in a page an error was getting displayed as "Visio Web Access is not available on this site".

I quickly found a solution for it as activation of the feature ""SharePoint Server Enterprise Site Collection features" at site collection level and also the activation of the feature "SharePoint Server Enterprise Site features" at site level.

I hope this will help you out.

Thanks,
Rahul Rashu
 

Saturday, 27 October 2012

How to Programmatically Approve documents in Sharepoint

Hi,

A requirement was posted to me where a developer wanted to approve the documents programmatically. I shared the code snippet below and it the logic worked out. I am sharing it here again:

using
(SPSite site = new SPSite("YourSiteUrl"))

{
using(SPWeb web = site.OpenWeb())

{
SPFolderCollection folders = web.Folders;

SPFolder folder = folders["DocumentLibraryName"];

SPFile file = folder.Files[itemIndex];

file.CheckIn("CheckInComment", SPCheckinType.MajorCheckIn);

file.Approve("Approved");

web.Update();

}

}

This code snippet can be modified in the way desired.

Thanks,


Rahul Rashu
 

Saturday, 8 September 2012

How to find the size of a subsite in Sharepoint 2010

Hi,

Recently a requirement was posted with me where the site administrators wanted to determine the size of their subsites as well and not only for the entire site collection or content database. The size of the content database can be determined easily and same for the site collection. However there was no direct way for the subsites. Hence I had to find out an alternative way for the same and after some research I found a way. The steps are as below:
1. Open any document library of the site which is one level up in site hierarchy for the subsite in concern.
2. In the ribbon select Library--> Open with Windows Explorer.
3. Now a windows explorer will open pointing to that document library. Now navigate to the site level.
4. This will show all the folder available under the site select the folder that corresponds to your site subsite in concern.
5. Right click and select properties. This will display the size.

I hope this will help you out.

Saturday, 11 August 2012

Powershell Script to list of the documents checked out with version details in a site collection in Sharepoint

Hi,

I received a recent requirement to create a report that provides the details of checked out items in an entire site collection. This report should also contain data for the person whom the document is checked out to. It should also provide the version and if no version exists it should mention the same.

So after playing with powershell for some time I prepared a script that works in exactly the same way.
If you want to extract this report to some .csv file then you need to provide this at the time of invoke itself.
For example:-  .\ScriptName.ps1 >FileName.csv
During the execution it will ask for the site url which you need to provide. It works with both Sharepoint 2007 and Sharepoint 2010 versions.




[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

function CheckedOutItems() {

write-host "Please enter the site url"
$url = read-host
write ("SiteURL`t" + "FileName`t" +  "CheckedOutTo`t" + "ModifiedDate`t"+"Version")
$site = New-Object Microsoft.SharePoint.SPSite($url)
$webs = $site.AllWebs
foreach($web in $webs)
{
$listCollections = $web.Lists
foreach($list in $listCollections)
{


if ($list.BaseType.ToString() -eq "DocumentLibrary")
{
 $dList = [Microsoft.Sharepoint.SPDocumentLibrary]$list
 $items = $dList.Items
$files = $dList.CheckedOutFiles
foreach($file in $files)
{

$wuse = $file.DirName.Substring($web.ServerRelativeUrl.Length)
Write ($web.Url+ "`t" + $wuse+"`/" + $file.LeafName +  "`t" + $file.CheckedOutBy.Name + "`t" + $file.TimeLastModified.ToString()+"`t" + "No Checked In Version" )
}
 foreach($item in $items)
 {
 if ($item["Checked Out To"] -ne $null)
  {
$splitStrings = $item["Checked Out To"].ToString().Split('#')

  Write ($web.Url+ "`t" + $item.Url + "`t" + $splitStrings[1].ToString() + "`t" + $item["Modified"].ToString() +"`t" + $item["Version"].ToString())
 }
 }


}



}
$web.Dispose()
}
$site.Dispose()
}


CheckedOutItems


I hope this will help you out.

Thanks,
Rahul Rashu