Posts

Showing posts from September 22, 2014

Deploye Commands for Powershell

Backup- SPSite  -Identity http://n-axisvpc4:4646 -Path c:\anil234\site4646.bak-->   Good and Best   Command To take the Site Back-up     Restore- SPSite  -Identity http://n-axisvpc4:6789 -Path c:\anil234\site4646.bak-->   Good and Best   Command To take the Site Restore       Add- SPSolution  - LiteralPath  C:\Back4646\KaizenContentType.wsp- ----> it  is used to add the   wsp  into Central admin   After manually you have to deploy in central administration   Update- SPSolution  –Identity  KaizenContentType.wsp  – LiteralPath  C:\VFSProjectH2.wsp – GACDeployment ----- > it is used for update a  wsp         stsadm  -o  deleteuser    - url  <URL name>   - userlogin   sharepoint \system   -group <group> -->   it is used to delete the system  acount (administrator) in groups     ststadm  -o export - url  http://n-axisvpc4:4646 -Filename c:\anil1234\4646.bak ----> s it e Back up     stsadm  -o  activatefeature  -fil

User profiles code (Get user details from)

protected void  Page_Load (object sender,  EventArgs  e)             {                 //string  CurrentLoginUser ;                         try                 {                     if (! IsPostBack )                     {                         using ( SPSite  site = new  SPSite ( SPContext.Current.Site.Url ))                         {                             using ( SPWeb  web = site.OpenWeb())                             {                                 SPSecurity.RunWithElevatedPrivileges(delegate()                                 {                                      SPServiceContext   oSPServiceContext  = SPServiceContext.GetContext(site);                                      UserProfileManager   upm  = new  UserProfileManager ( oSPServiceContext );                                      SPUser   spUser  = web.CurrentUser;                                     // UserProfileManager   ObjProfMgr  = new  User