How To Force SharePoint to Sync with Active Directory

Occasionally I have a user that changes their last name (or we got it spelled wrong) and I need the change to reflect across SharePoint (why SP doesn’t do this by itself I have no idea). In order to aid this process I found this script to force a resynchronize of each instance of the user profile in the user information lists. The script accepts one argument, which is the username to resync in the format DOMAN\User. Create a new powershell file with a ps1 extension and paste the code below into it.

$webapps = Get-SPWebApplication
 foreach ($webapp in $webapps) {
 [string] $login = $args[0]
 $sites = get-spsite -Limit All -WebApplication $webapp
 foreach ($s in $sites) {
 write-host $s.url
 $w = $s.RootWeb;
 $u = get-SPUser -Web $w -limit all | Where-Object {$_.userlogin -eq $login}
 if ($u -ne $null) {
 write-host "`t$($w.url)"
 Set-SPUser $u -SyncFromAD
 write-host "`tUpdated"
 }
 }
 }

After running it, you may get a few errors but you’ll notice their display name and other info is updated.

Code Updates

I haven’t worked on the Tri-Temp project in a while. I am going to go through and update the code a bit to lower the memory usage based on what I’ve learned for the LCC projects.

The original LCC code will have an update posted soon too. Mostly memory updates and a few control changes. I wasn’t sure if I wanted to bother but since the original LCC is still running my lizard’s climate I figured why not.

LCC v5 is almost ready

Lots of code changes and some hardware. Here’s some of them:

  • Added ShiftBright RGB LED to pins D2, D12 and D13
  • Added code for ShiftBright
  • Updated DEBUG routines
  • Day overhead handling is updated to wait longer before turning off
  • Added yellow and red LED indications for day overhead conditions
  • Night cold conditions are mirrors of day as appropriate
  • Switch 1 is now only for UV lights
  • Switch 2 is only for heat- in my case the heat rock is on all the time and the heat lamp is switched
  • Cleaned some functions of unneeded statements

Version 5 should be released soon. It’s still not running live yet. If you want an advance copy let me know.