Cancelling SharePoint solution deployment job

If a SharePoint solution deployment fails, yet the timer job is created and not running, you will be unable to redeploy or retract the solution.

The answer is hidden in that long list of stsadm operations:

stsadm –o canceldeployment –id 

This command will cancel the timer job that is meant to deploy the solution.

 

Enumerate all active deployment jobs:

stsadm -o enumdeployments

Cancelling SharePoint solution deployment job

Empowering SharePoint – moving tempdb database

–to move system database (tempdb)

–Determine the logical file names of the tempdb database and their current location on the disk.
SELECT name, physical_name AS CurrentLocation
FROM sys.master_files
WHERE database_id = DB_ID(N’tempdb’);
GO
–Change the location of each file by using ALTER DATABASE.
USE master;
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = ‘E:\SQLData\tempdb.mdf’);
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = ‘F:\SQLLog\templog.ldf’);
GO
–Stop and restart the instance of SQL Server. Because tempdb is re-created each time the instance of SQL Server is started, you do not have to physically move the data and log files. The files are created in the new location when the service is restarted in step 3. Until the service is restarted, tempdb continues to use the data and log files in existing location.
–Verify the file change.
SELECT name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
WHERE database_id = DB_ID(N’tempdb’);

 

Empowering SharePoint – moving tempdb database

Playin’ with lookup fields in SharePoint

0ne year for ‘dis blog 🙂

 

#Adding lookup field to list from another site collection
#not completely worked!

#Get the webs and lists
$web1 = Get-SPWeb http://len-shareappt/site1
$web2 = Get-SPWeb http://len-shareappt/site2
$ToTestLookupList = $web1.Lists.item(“ToTestLookup”)
$LookupList = $web2.Lists.item(“Lookup”)

#Add a lookup field
$ToTestLookupList.fields.AddLookup(“Lookup”, $LookupList.id, “false”)

#Get the created lookup field
$LookupField = $ToTestLookupList.Fields[“Lookup”]

#Set the lookup web ID and lookup field
$LookupField.LookupWebId = $LookupList.ParentWeb.ID
$LookupField.LookupField = $LookupList.Fields[“Foo”].InternalName
$LookupField.Update();

Playin’ with lookup fields in SharePoint

How to get site\web ID

$site = Get-SPSite “http://len-shareapp”
$web = $site.OpenWeb(“/lo”)
write-host $site.id
write-host $web.id

 

Output:

4fe00cc0-b57b-471a-b628-f48bad970e3e

2c0dc528-9d1c-4dd9-9723-f835be41fb85

 

Comapre with tp_SiteId in dbo.WSS_Content.Userinfo table

tp_SiteID tp_ID tp_DomainGroup tp_SystemID tp_Deleted tp_SiteAdmin tp_IsActive tp_Login tp_Title tp_Email tp_Notes tp_Token tp_ExternalToken tp_ExternalTokenLastUpdated tp_Locale tp_CalendarType tp_AdjustHijriDays tp_TimeZone tp_Time24 tp_AltCalendarType tp_CalendarViewOptions tp_WorkDays tp_WorkDayStartHour tp_WorkDayEndHour tp_Mobile tp_Flags

4FE00CC0-B57B-471A-B628-F48BAD970E3E 2492 0 0x010500000000000515000000688DE9CD84AC33A77BED249F0D050000 0 0 1 ECON\kotelnikova.ng Котельникова Наиля Газизовна kotelnikova.ng@lenserv.ru 0xD3DC00000100000000000000080000008B0600009006000095060000CB070000CC070000E0070000A40800009D090000 0x1CEB65D9000000003C020000EFEEEBEA010000001C00000000020000DFDEDBDA010500000000000515000000688DE9CD84AC33A77BED249F0D050000110000008C00000007000000A800000007000000B400000007000000C400000007000000D000000007000000DC00000007000000E800000007000000040100000700000020010000070000003C01000007000000580100000700000074010000070000009001000007000020AC01000007000020C801000007000020E401000007000000F401000060000000010500000000000515000000688DE9CD84AC33A77BED249F010200000101000000000001000000000102000000000005200000002102000001010000000000050200000001010000000000050B00000001010000000000050F000000010500000000000515000000688DE9CD84AC33A77BED249F77040000010500000000000515000000688DE9CD84AC33A77BED249F86040000010500000000000515000000688DE9CD84AC33A77BED249FEE040000010500000000000515000000688DE9CD84AC33A77BED249FB3040000010500000000000515000000688DE9CD84AC33A77BED249F1E050000010500000000000515000000688DE9CD84AC33A77BED249F78040000010500000000000515000000D4F279ED7A9DCA2AD2F041DF87550000010500000000000515000000D4F279ED7A9DCA2AD2F041DF37560000010500000000000515000000D4F279ED7A9DCA2AD2F041DF885500000102000000000005400000000A000000010100000000001000200000 2014-07-31 12:39:56.000 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 0

How to get site\web ID