Thursday, January 8, 2015

Execute Powershell script from Batchfile

Executing powershell script can be handy specially you want to schedule it using windows scheduler

It's Simple :


  • Create .bat file
  • Edit file with notepad
  • Add line
    •    powershell  filepath\yourscriptname.ps1
  • Save and Close file
  • Your powershell script is ready to run next time , when execute bat



Add new Item to share point list using powershell


Here is a simple example to add new item to sharepoint list. Every time powershell script is executed it will add new item to the list  with pre populated Title as data and time.

SharePoint Environment 2007

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$siteurl="https://site url"
$listname="List name"
$site=new-object Microsoft.SharePoint.SPSite($siteurl);
$web=$site.openWeb();
$list = $web.Lists[$listname] ;
$item = $list.Items.Add();
$item["Title"] = get-date;
$item.Update();
$web.Dispose();
$site.Dispose();
write-host "Item added to list $listname"

Monday, January 5, 2015

Moss 2007 Web services

http://msdn.microsoft.com/en-us/library/office/bb862916(v=office.12).aspx

Friendly NameLocationDescription
Alerts
/_vti_bin/alerts.asmx
Provides methods for working with alerts for list items in a SharePoint site.
Area Web service
/_vti_bin/areaservice.asmx
Deprecated Web service. Provides an area interface for remote clients.
Authentication Web service
/_vti_bin/Authentication.asmx
Provides ability for Web services to operate in conjunction with forms authentication.
BDC Fields Resolver Web service
/_vti_bin/bdcfieldsresolver.asmx
BDC Fields Resolver Web service for client applications. Reserved for internal use only.
BDC Web service
/_vti_bin/businessdatacatalog.asmx
Business Data Catalog metadata Web service. Reserved for internal use only.
CMS Content Area Toolbox Info Web service
/_vti_bin/contentAreaToolboxService.asmx
Designed for use by the Microsoft Office SharePoint Designer client to use.
Copy Web service
/_vti_bin/Copy.asmx
Provides methods for copying items between locations in the SharePoint environment.
List Data Retrieval Web service
/_vti_bin/DspSts.asmx
Provides a method for performing queries against lists in Windows SharePoint Services.
Document Workspace Web service
/_vti_bin/DWS.asmx
Provides methods for managing Document Workspace sites and the data they contain.
Excel Services Web service
/_vti_bin/ExcelService.asmx
Provides methods to call Excel Services remotely or to work as a callback for Web Parts.
Forms Web service
/_vti_bin/Forms.asmx
Provides methods for returning forms used in the user interface when working with the contents of a list.
Forms Services proxy Web service
/_vti_bin/FormsServiceProxy.asmx
Provides methods for Forms Services to proxy requests to remote data sources from Web-based forms.
Forms Services Web service
/_vti_bin/FormsServices.asmx
Provides methods to call Forms Services remotely or to work as a callback for Web-based forms.
Imaging Web service
/_vti_bin/Imaging.asmx
Provides methods that enable you to create and manage picture libraries.
Lists Web service
/_vti_bin/Lists.asmx
Provides methods for working with lists and list data.
Meetings Web service
/_vti_bin/Meetings.asmx
Provides methods that enable you to create and manage Meeting Workspace sites.
Official File Web service
/_vti_bin/officialfile.asmx
Provides methods for sending files to a records repository.
People Web service
/_vti_bin/People.asmx
Provides methods for working with security groups.
Permissions Web service
/_vti_bin/Permissions.asmx
Provides methods for working with the permissions for a site or list.
Published Links Web service
/_vti_bin/publishedlinksservice.asmx
Office system client applications and other applications can obtain the list of published links on the server that are targeted to the current user.
Publishing Service Web service
/_vti_bin/PublishingService.asmx
Provides methods to remotely work with the publishing service.
Search Web service
/_vti_bin/search.asmx
Allows access to Enterprise Search results from client applications and Web applications outside of the context of a SharePoint site.
SharePoint Directory Management Web service
/_vti_bin/sharepointemailws.asmx
Provides methods for remotely managing distribution groups.
Sites Web service
/_vti_bin/sites.asmx
Provides methods for returning information about the site templates for a site collection.
Slide Library Web service
/_vti_bin/SlideLibrary.asmx
Provides methods for slide library callbacks or remote publishing of slides.
Search Crawl Web service
/_vti_bin/spscrawl.asmx
Provides methods for remote Office SharePoint Server 2007 server farms to crawl a local farm.
Search Web service
/_vti_bin/spsearch.asmx
Provides methods for remotely performing searches within a Windows SharePoint Services deployment.
Users and Groups Web service
/_vti_bin/UserGroup.asmx
Provides methods for working with users, site groups, and cross-site groups.
User Profile Change Web service
/_vti_bin/userprofilechangeservice.asmx
Provides methods to query the user profiles change log remotely.
User Profile Web service
/_vti_bin/userprofileservice.asmx
Provides a user profile interface for remote clients.
Versions Web service
/_vti_bin/versions.asmx
Provides methods for working with file versions.
Views Web service
/_vti_bin/Views.asmx
Provides methods for working with views of lists.
Web Part Pages Web service
/_vti_bin/webpartpages.asmx
Provides the methods to send information to and retrieve information from Web services.
Webs Web service
/_vti_bin/Webs.asmx
Provides methods for working with sites and subsites.
Workflow Web service
/_vti_bin/workflow.asmx
Provides methods to work with workflows.

Tuesday, December 16, 2014

Remove the existing metadata during document upload



Refer script here : http://vinayak-projects.blogspot.com/2014/05/feature-id-not-assigned-when-saving.html

Sunday, November 16, 2014

Slipstream for sharepoint installation


Slipstream for sharepoint




Moss

http://blogs.technet.com/b/seanearp/archive/2009/05/20/slipstreaming-sp2-into-sharepoint-server-2007.aspx


Sharepoint 2010 


http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=295

Tuesday, September 30, 2014

Check all database Size SQL Server

SELECT d.name,
ROUND(SUM(mf.size) * 8 / 1024, 0) Size_MBs
FROM sys.master_files mf
INNER JOIN sys.databases d ON d.database_id = mf.database_id
WHERE d.database_id > 4
-- Ignore system databases
GROUP BY d.name
ORDER BY Size_MBs DESC

Wednesday, May 28, 2014

Feature id not assigned when saving a list as a template

It's pretty obvious that you will use List template to create similar list as you have created earlier within your share point environment .

During the course of action of saving a list template and uploading to List template Gallery and creating list from template , you notice template name is from missing from Libraries or custom list.

So if you check List template under galleries you will also find feature id is missing for this template.



This issue occurs due to ParserEnabled property is set to false for web application 

Use power shell script to resolve this issue

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$siteurl="http://Your Site name/default.aspx"
$site=new-object Microsoft.SharePoint.SPSite($siteurl);
$web=$site.openWeb();
$web.ParserEnabled = $true
$web.update();
$web.Dispose();
$site.Dispose();


Remove list template and upload again and you should be able to see feature ID is associated with it .

Targeted share point version MOSS 2007

More reference here.

Thursday, May 22, 2014

How to get worker process PID and associated ID ( PID for W3WP.exe)

For troubleshooting specific application pool in server where multiple websites are running
Use following command for IIS 6.0 and Windows Server 2003

C:\WINDOWS\system32 >cscript iisapp.vbs


This command will give application pool names and respective process id.

 Using these PID’s each worker process (w3wp.exe) can be monitor under task manager . PID column is not enabled by default it can be added manually.























ProcDump tool can be used for further investigation .

Thursday, April 24, 2014

Immediate alerts and email notification not getting send Moss 2007

Many time during the business hours we receive this type of issue. following steps may help to resolve this issue.

Scenario : Email accounts are setup , alerts was working earlier , suddenly users stop receiving alerts.


This could be caused by Timer service locked the content database and alerts are getting stuck in queue.

Use query to check by which server timer service is locked  (Off course if you have multiple server farm environment)

#1
use [Your Content database]
select * from timerlock (nolock)

You can also check what event cache table is holding currently

#2
SELECT * FROM eventcache WITH (nolock) WHERE EventData is not null

If you see large no of items in queue you may go ahead and restart the timer service on the server. (First query will give you server name)

Actual alerts sending can take 20 min of time and can be verified  running second query again . If everything goes well you should see no record pending in second query output.