(Get-SPFarm).Solutions | ForEach-Object{$var = "Folder Path" + "\" + $_.Name;$_.SolutionFile.SaveAs($var)}
Monday, 2 February 2015
Thursday, 29 January 2015
Get SPGroup users in SharePoint programmatically
SPGroup UserGroup = OWeb.Groups["User Group Name"];
if (UserGroup.Users.Count > 0)
{
foreach (SPUser User in UserGroup.Users)
{
string UserName=User.LoginName;
}
}
if (UserGroup.Users.Count > 0)
{
foreach (SPUser User in UserGroup.Users)
{
string UserName=User.LoginName;
}
}
Wednesday, 28 January 2015
Adding and Deploying solution using powershell in SharePoint
Add Solution:
add-SPSolution "wsp file path"
Deploy Solution:
Install-SPSolution –Identity "example.wsp" –WebApplication "http://sp2013" -GACDeployment
Update Solution:
Update-SPSolution –Identity "example.wsp" –LiteralPath "Wsp path" –GACDeployment
Retract Solution:
Uninstall-SPSolution –Identity "Example.wsp" –WebApplication "http://sp2013"
Remove Solution:
Remove-SPSolution –Identity "Example.wsp"
add-SPSolution "wsp file path"
Deploy Solution:
Install-SPSolution –Identity "example.wsp" –WebApplication "http://sp2013" -GACDeployment
Update Solution:
Update-SPSolution –Identity "example.wsp" –LiteralPath "Wsp path" –GACDeployment
Retract Solution:
Uninstall-SPSolution –Identity "Example.wsp" –WebApplication "http://sp2013"
Remove Solution:
Remove-SPSolution –Identity "Example.wsp"
Wednesday, 21 January 2015
Get all user name and id in web using powershell
Get-SPUser -web "Site Url" | ForEach-Object{ ""+ $_.Id+""+$_.Name}
Wednesday, 7 January 2015
Check current user in SPFieldUser collection
SPFieldUserValueCollection usercoll= new SPFieldUserValueCollection(oweb, item["usercoll"].ToString());
bool containuser=likedBy.Find(u => u.User.LoginName.ToString().Contains(SPContext.Current.Web.CurrentUser.LoginName))!= null ? true : false;
bool containuser=likedBy.Find(u => u.User.LoginName.ToString().Contains(SPContext.Current.Web.CurrentUser.LoginName))!= null ? true : false;
Subscribe to:
Posts (Atom)