08 December 2012

Update and synchronize user names in SharePoint

Often - people change their names in the organization - getting married, getting divorced, or just decide to change their name because ...

For some reason, SharePoint can not synchronize the new names.



Here's a command  for a version of SharePoint 2007 and up that will help you


stsadm -o migrateuser -oldlogin Domain\OldUserName -newlogin Domain\NewUsername -ignoresidhistory

For a version of SP 2010 and up , With PowerShell


Move-SPUser –Identity "Domain\OldUserName" –NewAlias "Domain\NewUsername"


Enjoy,
Roi

07 December 2012

Procedure links to government sites

Some of the requirements of government Web sites or sites of municipal authority, that if there is an external link, the client will notice that explains to him that the site is directed not belong to the same authority.



Here is a Jquery code that can help you


$(document).ready(function () {

    $("a").click(function(event) {

        // check if the target link is yoursite.gov

        // if not will show alert message

        if (this.href.indexOf("yoursite.gov") == -1) {

            if (this.href.startsWith("http")) {

                event.preventDefault();

                var linkLocation = this.href;

                alert('Please note that you are directed to an external site does not belong to this government ');

                window.open(linkLocation, '');

                return false;

            }

        }

    });

});


Thank you,
Roi