Set-ExecutionPolicy unrestricted
echo " "
echo "MySharepointSolution"
$sln = get-spsolution -identity MySharepointSolution.wsp
uninstall-spsolution -identity MySharepointSolution.wsp -confirm:$false
echo "Started solution retraction..."
while($sln.JobExists) {
echo " > Working..."
start-sleep -s 10
}
remove-spsolution -identity MySharepointSolution.wsp -confirm:$false
echo "Removed MySharepointSolution"
echo " "
Etykiety
- C# (1)
- CodeSnippet (7)
- Excel (1)
- IIS (1)
- InfoPath (1)
- jQuery (2)
- SharePoint 2010 (31)
- SharePoint 2013 (4)
- SharePoint Management Shell (4)
- SQL Server (1)
- Visual Studio (2)
- Visual Studio 2010 (1)
- XSL (1)
O mnie
wtorek, 12 listopada 2013
środa, 30 października 2013
Make Visual Studio to add .dll to GAC after each build
Go to Project > Properties and enter the following into the Post-build event command line:
(on Windows Server 2012)
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe" /i
"$(TargetPath)" /f
(on Windows Server 2008)
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe" /i "$(TargetPath)" /f
Remember to:
(on Windows Server 2012)
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe" /i
"$(TargetPath)" /f
(on Windows Server 2008)
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe" /i "$(TargetPath)" /f
Remember to:
- run Visual Studio as Administrator
- sign the assembly
wtorek, 22 października 2013
Replace columns in DataTable and by the way insert at specified position (code snippet)
DataTable table = GetSomeDataTable();
table.Columns.Add("NewNumber", typeof(int)).SetOrdinal(table.Columns["OldColumn1"].Ordinal);
table.Columns.Add("NewText", typeof(string)).SetOrdinal(table.Columns["OldColumn2"].Ordinal);
foreach (DataRow row in table.Rows)
{
row["NewNumber"] = Transform1(row["OldColumn1"]);
row["NewText"] = Transform2(row["OldColumn2"]);
}
table.Columns.Remove("OldColumn1");
table.Columns.Remove("OldColumn2");
table.Columns.Remove("OldColumn2");
poniedziałek, 23 września 2013
SharePoint user - when there are changes in AD
When some user data change in AD (e.g. last name) this change in most cases is not properly synchronized to SharePoint site collection.
The following Power Shell commands may help:
Sadly it doesn't help in case an account name in AD has been changed. Then we have an orphaned user situation and the solution is to delete the account in SharePoint.
If it's only one site collection with couple of users, the quick way is to do it manually via Site collection - go to this page: http://sitecollection/_catalogs/users/simple.aspx
The following Power Shell commands may help:
$user = get-spuser -Identity domain\username -Web http://server:port
Set-SPuser -Identity $user -SyncFromAD
Set-SPuser -Identity $user -SyncFromAD
Sadly it doesn't help in case an account name in AD has been changed. Then we have an orphaned user situation and the solution is to delete the account in SharePoint.
If it's only one site collection with couple of users, the quick way is to do it manually via Site collection - go to this page: http://sitecollection/_catalogs/users/simple.aspx
wtorek, 10 września 2013
Przeniesienie SharePoint Server 2013 na nową maszynę wirtualną
Na poprzedniej maszynie:
- Sporządzić listę baz danych używanych przez SharePoint server: Central Administration -> Upgrade and Migration -> Review database status
- Shutdown IIS
- Zatrzymać wszystkie windows services związane z SharePoint-em.
Przenosiny:
- Przenieść wszystkie bazy danych na nowy SQL server (Backup+Restore)
- Przenieść obraz maszyny wirtualnej z SharePoint server. Jeśli była to instalacja SharePoint+SQL Express na jednej maszynie, poprzedni punkt jest oczywiście zbędny.
Na nowej maszynie:
- Uruchomić Sql Server Configuration Manager w celu zdefiniowania aliasów. Należy utworzyć identyczne aliasy dla SQL Native Client [VERSION] Configuration (dla 32 i 64 bitowego):
- w polu Alias Name wpisać nazwę Sql Servera z poprzedniej maszyny,
- skopiować nazwę do pola Server i zmodyfikować wpis o nazwę bieżącej maszyny. - Aby aliasy działały, trzeba używać protokołu TCP/IP. W Sql Server Configuration Manager wejść do SQL Server Network Configuration>Protocols for SHAREPOINT. TCP/IP powinien być włączony a Shared Memory wyłączony.
- Wykonać restart maszyny
- Uruchomić sharepoint-owe windows services,
- Odszukać windows service SQL Server Browser i uruchomić/upewnić się że działa.
- Sprawdzić czy SharePoint łączy się z właściwym serwerem bazy danych za pomocą procedury składowanej sp_who,
- Należy zmienić nazwę serwera ShaerPointa za pomocą programu stsadm.exe. Dla wersji 2013 znajduje się on w folderze: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN.
Polecenie zmiany nazwy serwera:stsadm -o renameserver -oldservername <YourOldServerName> -newservername <YourNewServerName>
czwartek, 23 maja 2013
Enable Session State in Sharepoint 2013
1. Run in PowerShell:
Enable-SPSessionStateService –DatabaseName "<your database name>"
or, if you don't mind guids in database names:
Enable-SPSessionStateService -DefaultProvision
2. Open web.config of the WebApplication where you want SessionState to be enabled and change line
<pages enableSessionState="false" (...)
to
<pages enableSessionState="true" (...)
3. Restart IIS
Enable-SPSessionStateService –DatabaseName "<your database name>"
or, if you don't mind guids in database names:
Enable-SPSessionStateService -DefaultProvision
2. Open web.config of the WebApplication where you want SessionState to be enabled and change line
<pages enableSessionState="false" (...)
to
<pages enableSessionState="true" (...)
3. Restart IIS
czwartek, 4 kwietnia 2013
Rename SharePoint Web Application
$wa = Get-SPWebApplication "SharePoint - 80"$wa.Name = "Magical Web App"$wa.Update() |
Subskrybuj:
Posty (Atom)
