powershell etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
powershell etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

7 Şubat 2013 Perşembe

Setting Object Cache Accounts in SharePoint 2010

Hi,

Just copy the code below, change the first 3 parameters, you are good to go !

Note:
If you use claims auth. you need to add "i:0#.w|" in front of your username like I did.

$wa = Get-SPWebApplication -Identity http://yoururl
$SuperUserAcc = "i:0#.w|WW300\w99s0700"
$SuperReaderAcc = "i:0#.w|WW930\w99s0700"
Function Set-WebAppUserPolicy($wa, $userName, $displayName, $perm)
{
    [Microsoft.SharePoint.Administration.SPPolicyCollection]$policies = $wa.Policies
    [Microsoft.SharePoint.Administration.SPPolicy]$policy = $policies.Add($userName, $displayName)
    [Microsoft.SharePoint.Administration.SPPolicyRole]$policyRole = $wa.PolicyRoles | where {$_.Name -eq $perm}
    If ($policyRole -ne $null) {
        $policy.PolicyRoleBindings.Add($policyRole)
    }
    $wa.Update()
}

$wa.Properties["portalsuperuseraccount"] = $SuperUserAcc
Set-WebAppUserPolicy $wa $SuperUserAcc "Super User (Object Cache)" "Full Control"
$wa.Properties["portalsuperreaderaccount"] = $SuperReaderAcc
Set-WebAppUserPolicy $wa $SuperReaderAcc "Super Reader (Object Cache)" "Full Read"
$wa.Update()

15 Ekim 2012 Pazartesi

Sharepoint add new managed account via power shell

Hi,

What you need to do is:
Type:

$cred = Get-Credential

Enter your credits on logon screen.

Create account cmd:
New-SPManagedAccount –Credential $cred

Check account if created:
Get-SPManagedAccount


Source:
http://www.petestilgoe.com/2011/01/sharepoint-2010-adding-a-new-managed-account-from-different-domain-errors-with-access-denied/

9 Ekim 2012 Salı

Cannot uninstall Language Pack 0 because it is not deployed

If you have this error, it means you are trying to uninstall a solution which is not installed (deployed).

So,
First check Central Administration - System Settings - Manage Farm Solutions - Check if your solution is deployed. If it is not, deploy it.

If you have trouble by deploying it, try to remove the solution. (Yeah, skip uninstall phase)

Removing solution PowerShell cmd:
Remove-SPSolution -Identity solution.wsp -Force
Removing solution stsadm cmd:
stsadm -o deletesolution -name solution.wsp -override

Add Solution PowerShell cmd:
Add-SPSolution D:\solution.wsp
Add Solution stsadm cmd:
stsadm.exe -o addsolution -filename D:\solution.wsp

Install Solution PowerShell cmd:
Install-SPSolution –Identity solution.wsp -GACDeployment -Force
Install Solution stsadm cmd:
stsadm -o deploysolution -name solution.wsp -immediate -allowCasPolicies -force -allowGacDeployment

2 Ekim 2012 Salı

Sharepoint 2010 Restore a site collection backup

Hı,

If you d like to restore a site collection you should open the PowerShell as admin and type the following command:


Restore-SPSite -Identity "http://yoururl" -Path "C:\SiteCollectionBackups\backup.bak" -Force


Source:
http://sharepointciyiz.biz/post/2011/07/08/SharePoint-2010-Site-Collection-Backup-and-Restore.aspx

1 Ekim 2012 Pazartesi

Sharepoint 2010 Export all the solutions (wsp files)

Hi,

If you d like to get all the solutions (wsp files) from a sharepoint server and save them into a location, you just need the below code:

Open the Power Shell as Admin, type:


Add-PSSnapin Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue 
## setup our output directory 
$dirName = "d:\exports\ExportedSolutions
Write-Host Exporting solutions to $dirName 
 foreach ($solution in Get-SPSolution) 
 { 
 $id = $Solution.SolutionID 
 $title = $Solution.Name 
 $filename = $Solution.SolutionFile.Name 
 Write-Host "Exporting ‘$title’ to …\$filename" -nonewline 
 try 
 $solution.SolutionFile.SaveAs("$dirName\$filename")
 Write-Host " – done" -foreground green 
 } 
 catch 
 {
 Write-Host " – error : $_" -foreground red 
 }
 }

You can change the output location as you want, it would save all the solutions.

Great time saver !

Cheers

PS: Sorry I forgot to give the source, but you can google it though.

21 Haziran 2012 Perşembe

Reinstall a WSP Package in Sharepoint 2010

Steps:
1. Retract
2. Delete Solution
3. Add Solution
4.Deploy Solution

1.Retract:
Go To Central Admin - System Settings - Manage Farm Solutions - Select and Retract the solution

2.Delete Solution:
Open PowerShell as Admin
Type
Remove-SPSolution –Identity YOUR_WSP_NAME.wsp

3.Add Solution:
Open 14 hive in cmd
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14
Run command:
stsadm.exe -o addsolution -filename D:\YOUR_WSP_NAME.wsp

4. Deploy Solution:
Go To Central Admin - System Settings - Manage Farm Solutions - Select and Deploy solution