Monday, December 22, 2014

Vmware Player and hyper-V incompatable

Got the below error while running the VM on my laptop which has Windows 8.1












The solution is disable the Hyper-V using the below url.
http://www.eightforums.com/tutorials/42041-hyper-v-enable-disable-windows-8-a.html



Sunday, December 21, 2014

Calling stored procedure from another stored procedure SQL Server


While migrating users in SharePoint, i need to take care of migrating user in custom DB level.
Wrote a below script to upgrade the users with new DOMAIN account name.

ALTER PROCEDURE [DB3].[dbo].[UpdateDomainUser_WithClaim]
(
@oldUser nvarchar(300),
    @newUser nvarchar(300)
    )
AS
BEGIN
....
EXEC [DB1].[dbo].UpdateDomainUser_SP1_WithClaim @oldUser ,@newUser
EXEC [DB2].[dbo].UpdateDomainUser_SP2_WithClaim @oldUser ,@newUser
END

Restore Database using Management Studio Express

Thursday, December 18, 2014

Migrating user accounts from one AD domain to another AD Domain using Powershell

Got the opportunity to migrate the users from one domain to another domain. Users should migrate in Nintex DB too.

$nwcmd = 'C:\Program Files\Nintex\Nintex Workflow 2010\NWAdmin.exe'
$nwarg1 = '-o'
$nwarg2 = 'MigrateUser'
$nwarg3 = '-oldUser'
$nwarg4 = '-newUser'
$errorstatus=$ErrorActionPreference

Add-PSSnapin Microsoft.SharePoint.PowerShell -ea silentlycontinue

$m = [Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager]::Local
Function Get-SPClaim {
    param ([string]$user)
    $claim = New-SPClaimsPrincipal -identity $user -IdentityType "WindowsSamAccountName"
    return $m.EncodeClaim($claim)
}



function MigrateUserOrGroups($migrationType, $csvFile)
{
   #Getting the SPFarm object
   $farm = Get-SPFarm

   Write-Host $migrationType
   #Checking whether the user input the type of Migration as Group
   if($migrationType -eq "Group"){
   Import-Csv $csvFile | ForEach-Object{
      Write-Host "Migrating Group" $_.oldlogin "to" $_.newlogin -ForegroundColor Green
      $farm.MigrateGroup($_.oldlogin, $_.newlogin)
     
       }
      }
     
    #Checking whether the user input the type of Migration as User
    if($migrationType -eq "User")
    {

        Import-Csv $csvFile | ForEach-Object{
       
        $olduser= Get-SPClaim($_.oldlogin);
            $newuser= Get-SPClaim($_.newlogin);
            $oldloginname=$_.oldlogin
            try
            {
                $ErrorActionPreference="stop"
               
                Write-Host $newuser
                Write-Host "Migrating User" $_.oldlogin "to" $_.newlogin -ForegroundColor Green
                $farm.MigrateUserAccount( $olduser, $newuser, $false )
                write-host $nwcmd $nwarg1 $nwarg2 $nwarg3 """$olduser""" $nwarg4 """$newuser"""
                & $nwcmd $nwarg1 $nwarg2 $nwarg3 $olduser $nwarg4 $newuser
               
             }
             catch
             {
                write-host "Exception occured for migrating user"  $oldloginname " Message: $($_.Exception.Message)" -ForegroundColor Red
             }
             finally
             {
                $ErrorActionPreference=$errorstatus
             }
               
        }    
    }
     
   Write-Host "Migration Completed" -ForegroundColor Cyan
 
 
 
}

MigrateUserOrGroups $args[0] $args[1]
Follow below links
http://blogs.msdn.com/b/sowmyancs/archive/2012/01/07/migrate-users-groups-powershell-script.aspx?PageIndex=2
http://sharepoint.stackexchange.com/questions/118424/how-to-migrate-ad-domain-groups-in-sharepoint-2010

Monday, December 15, 2014

Monday, April 2, 2012

Icon Rollover using jQuery in SharePoint 2010

1)Add a CQWP on the sharepoint page.
2)Open SPD2010
3)Edit it with the following code...

$(document).ready(function() {
$("img.rollover").hover(
function() { this.src = this.src.replace("_UP", "_OVER");});
$("img.rollover").mouseout(
function() { this.src = this.src.replace("_OVER", "_UP");});

});

Save it and refresh the page on the browser.
UseFul link:
http://kaidez.com/tutorial-simple-effective-jquery-image-rollover/