SharePoint, SharePoint, and SharePoint again. Today I want to post something about how we can import from Active Directory but with the FQDN and NetBIOSName completely different. If your domain FQDN is (for example) gembelcorpse.co.id, and your NetBIOS Name set to GC, then you do have a problem. When you let this SharePoint User Profile imports from your active directory, it will make the User Profile import like GEMBELCORPSE\administrator, or GEMBELCORPSE\user1, and that’s totally wrong.
In the previous version of SharePoint (2007), we don’t need to do this tips, all things are automatically done by system. Now, in SharePoint 2010, we must do this kind of tips. So, take a look at this PowerShell code.
- param($ServiceApplicationName)
- $ServiceApps = Get-SPServiceApplication
- $UserProfileServiceApp = ""
- foreach ($sa in $ServiceApps)
- {if ($sa.DisplayName -eq $ServiceApplicationName)
- {$UserProfileServiceApp = $sa}
- }
- if ($UserProfileServiceApp -eq "")
- {
- Write-Host "Ooops..., Service Application '$($ServiceApplicationName)' not found."
- }
- else
- {
- Write-Host "Found '$($UserProfileServiceApp.DisplayName)'..."
- if ($UserProfileServiceApp.NetBIOSDomainNamesEnabled -eq 1)
- {
- Write-Host "NetBIOSDomainNamesEnabled in '$($UserProfileServiceApp.DisplayName)' already enabled, nothings updated!"
- }
- else
- {
- Write-Host "Press any key to continue, [Esc] to cancel..."
- $Key = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
- if ([int]$Key.Character -eq 27)
- {
- Write-Host "Canceling update to '$($UserProfileServiceApp.DisplayName)'..."
- }
- else
- {
- $UserProfileServiceApp.NetBIOSDomainNamesEnabled = 1
- $UserProfileServiceApp.Update()
- Write-Host "Done Updating '$($UserProfileServiceApp.DisplayName)'!"
- Write-Host "Please run Full Synchronization to import all User Profile."
- }
- }
- }
With that PowerShell code, run it using SharePoint PowerShell, you can run it from Start menu > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell.
Run it using –ServiceApplicationName argument. If your User Profile Service Application Name is User Profile SSA, then you should run it like this command below.
.\SP2010EnableNetBIOSName.ps1 -ServiceApplicationName "User Profile SSA"
NOTE: You must run this script on a newly created User Profile Service Application. If you already have the existing, you must delete it, or create another User Profile Service Application. Don’t do the Full Synchronization, configure it first (point to active directory), and then run this script, and then run the Full Synchronization of your User Profile Service Application.
Nice….! click +1 if you do like