29 Agu 2022
Why SharePoint Can't Be Hosted on Azure App Service?
13 Jun 2017
PowerShell Script: Upload Large File to SharePoint in Chunks
Get back to the business again! Just wanted to share another great things in SharePoint (although to user is not fun at all).
According to MSDN, there are a few options to upload files to SharePoint.
3 Apr 2017
SharePoint CAML Query through jQuery
I was just digging into my code snippet, and I thought this worth to share. I got the sample code where we can query using CAML in jQuery.
After a few tests, it’s still valid to be used. Here it is!
var DocLibName = "Shared Documents";
var camlQry =
"<View Scope='RecursiveAll'>" +
"<Query>" +
"<Where>" +
"<And>" +
"<Leq>" +
"<FieldRef Name='Created'/>" +
"<Value Type='DateTime'><Today /></Value>" +
"</Leq>" +
"<Eq>" +
"<FieldRef Name='FSObjType'/>" +
"<Value Type='Integer'>0</Value>" +
"</Eq>" +
"</And>" +
"</Where>" +
"</Query>" +
"</View>";
var requestData = { "query" :
{ "__metadata" :
{ "type" : "SP.CamlQuery" },
"ViewXml" : camlQry
}
};
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('" + DocLibName + "')/GetItems?$expand=FieldValuesAsText",
method: "POST",
async: false,
data: JSON.stringify(requestData),
headers: {
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"Accept": "application/json; odata=verbose",
"Content-Type": "application/json; odata=verbose"
},
success : function(d) {
$.each(d.d.results, function (iRow, vRow) {
//do your own processing here
});
}, error : function(a, b, c) {
console.log(a);
console.log(b);
console.log(c);
}
});
Enjoy!
22 Mar 2017
PowerShell Script to Iterate All Documents (including sub-folders)
Seems like I want to dump again an old script to you. This PowerShell Script is commonly used to list down all documents in the Document Library regardless of their location, whether it’s in the root or sub-folders.
No need to explain in detail again, here’s the script.
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.WorkflowServices.dll"
$Siteurl = "https://consotoayam.com/sites/EPRG" #you can replace this url with your own
$ListName = "Shared Documents" #replace this with your own Document Library name
$credential = Get-Credential #to prompt for credential
if ($SiteUrl -ne $null)
{
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl)
if ($ctx -ne $null)
{
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($credential.UserName, $credential.Password)
$st = $ctx.Site
$wb = $ctx.Web
$DocsLib = $wb.Lists.GetByTitle($ListName)
$q = New-Object Microsoft.SharePoint.Client.CamlQuery
$q.ViewXml = '0 '
$items = $DocsLib.GetItems($q)
$ctx.Load($st)
$ctx.Load($wb)
$ctx.Load($DocsLib)
$ctx.Load($items)
$ctx.ExecuteQuery()
foreach($item in $items)
{
#if necessary, you can load the item
$ctx.Load($item)
$ctx.ExecuteQuery()
}
}
}
Enjoy!
19 Agu 2016
Simple Workaround for Content Editor Webpart in Another Site Collection
Guess what? You have created a HTML script stored somewhere in SharePoint, and you want to use it somewhere in another Site Collection. But you are stuck with this error, “Cannot retrieve the URL specified in the Content Link property. For more assistance, contact your site administrator”.
There are a few workarounds you can try.
Using Page Viewer or IFRAME
To use the page viewer, the solution is quite straight-forward and can be described in a few sentences.
Firstly, you know that you have created the HTML script, now create a page in the same Site Collection, then add Content Editor Webpart that links to the HTML script.
Then you can go to the other Site Collection, create a page with Page Viewer, or direct HTML with IFRAME which links to the page created in previous step. Remember, the SharePoint top links bar and left navigation will still be displayed. To overcome that, you can add query string “IsDlg=1” at the end of the URL.
If your URL is like: http://contoso.com/Pages/cewp.aspx, then it should be like http://contoso.com/Pages/cewp.aspx?IsDlg=1.
Using jQuery
If your masterpage is attached with jQuery, you can re-use the following code.
<div class="pp-container">
</div>
<script type="text/javascript">
$.ajax({
url: "/SiteAssets/common/thescripts.txt",
method: "GET",
success: function (data) {
$('div.pp-container').append(data);
},
error: function (data) {
console.log("Error:");
console.log(data);
}
});
</script>
Where "/SiteAssets/common/thescripts.txt" is the URL of your HTML script.
8 Agu 2016
Tips: Open Office Document Online (Web Version) in SharePoint
In SharePoint, there are 2 ways of setting a link to an Office Document. The most common way we’ve always seen is by direct link, which will download the Office document to your local storage.
Now, there’s another way to link to an Office document and force it to open in Online viewer such as Excel Online, PowerPoint Online, or Word Online. The most possible way is to copy the URL by clicking on the ellipsis next to the filename.
Now, you’ll see something similar to this, which will force-open the file in Excel Online:
https://www.contoso.com/Shared%20Documents/Essential%20Regulatory%20Documents%20Inventory%20List%20Template.xlsx?d=we035ad79215c4e82ba32d989b66bacfd
Or at any point of time if you know the direct URL to the file but unsure what is the number or code next to d=, you can just put the link as below.
This way, it will forcefully open the excel (or essentially any Office document) in Online Viewer.
WAIT, there’s more! I know that you’re going to complain!
27 Jul 2016
Using jQuery to Send Email from SharePoint
I’ve been outside of this blog so far and never post anything in this blog. But let me share a small code snippet that can be used. Below is the code to send email from SharePoint.
var EmailInfo = {
To : { Address : 'radityo.ardi@gmx.com' },
Subject : 'This is the subject',
Body : 'This is the <b>Body</b>'
};
$.ajax({
url: _spPageContextInfo.webServerRelativeUrl +
'/_api/SP.Utilities.Utility.SendEmail',
contentType: 'application/json',
type: "POST",
headers: {
"Accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
data: JSON.stringify({
'properties': {
'__metadata': { 'type': 'SP.Utilities.EmailProperties' },
'From': 'Radityo Ardi',
'To': { 'results': [EmailInfo.To.Address] },
'CC': [],
'Subject': EmailInfo.Subject,
'Body': EmailInfo.Body
}
}),
success: function(dataSendEmail) {
alert('Email successfully sent.');
},
error: function(err) {
console.log(err);
}
});
13 Mar 2013
Assign a User to Manage SharePoint User Profile
Maybe in some of particular scenario, we found that the user wanted to manage user profile alone without using Farm Administrator Account and to keep the user with a minimal security access.
That way, we can configure User Profile Service Application to have particular user granted as User Profile Manager. So they can go to Central Administration website without touching other configuration.
How we can do this?
28 Feb 2013
Visual 2010 Macro: Automate “Attach to Process” to IIS Worker Process (w3wp.exe)
If you take a look at my post a few months ago about my own development environment, maybe you didn’t notice that I posted a link to a macro. This macro I’ve created myself to help me build SharePoint solutions faster than normally we do, rather than we do an “Attach to Process” on the menu and search which w3wp, or even worse, by attaching it to all w3wp which we don’t need.
So, in the code below, I put 2 functions, AttachW3WP(string AppPoolName) and AttachProcess(string ProcessName). Same way, you can create another function, call that function to attach to particular w3wp process with specific Application Pool Name.
This should work with IIS 7.0 above, as IIS 6.0 (or even IIS 5.1) I’ve never tested it out.
- Imports System
- Imports EnvDTE
- Imports EnvDTE80
- Imports EnvDTE90
- Imports EnvDTE90a
- Imports EnvDTE100
- Imports System.Diagnostics
- Imports System.Linq
- Imports System.ComponentModel
- Imports System.Collections
- Imports System.Collections.Generic
- Imports System.Management
- Public Module RdzMacros
- Dim DebugPanel As String = "Debug"
- Dim Ow As OutputWindow = DTE.ToolWindows.OutputWindow
- Dim Owp As OutputWindowPane
- Dim SetName As String = "ApplicationPoolName"
- Dim Titl As String = "AttachW3WP"
- Private Sub PanelInit()
- Try
- Owp = Ow.OutputWindowPanes(DebugPanel)
- Catch ex As Exception
- If Owp Is Nothing Then
- Owp = Ow.OutputWindowPanes.Add(DebugPanel)
- End If
- End Try
- End Sub
- Private Function GetAppPoolName() As String
- Dim sRet As String = ""
- Try
- sRet = DTE.Solution.Globals(SetName)
- Catch ex As Exception
- End Try
- Return sRet
- End Function
- Private Sub AttachW3WP(ByVal AppPoolName As String)
- PanelInit()
- Dim attached As Boolean = False
- Dim proc As EnvDTE.Process
- Dim ProcessName As String = "w3wp.exe"
- Dim PID As Integer = 0
- Dim CmdLine As String = AppPoolName 'GetAppPoolName()
- If String.IsNullOrEmpty(CmdLine) Then
- MsgBox("Set Application Pool Name first via 'SetApplicationPoolName' macro.", MsgBoxStyle.Critical, Titl)
- Exit Sub
- End If
- Owp.OutputString(String.Format("Search for IIS Worker Processes with AppPool '{0}'...", CmdLine))
- Dim wmiQuery As String = "select CommandLine,ProcessID from Win32_Process where Name='" + ProcessName + "'"
- Dim searcher As ManagementObjectSearcher = New ManagementObjectSearcher(wmiQuery)
- Dim retObjectCollection As ManagementObjectCollection = searcher.Get
- For Each retObject As ManagementObject In retObjectCollection
- If retObject("CommandLine").ToString().ToLower().Contains("\" + CmdLine.ToLower() + "\") = True Then
- PID = Convert.ToInt32(retObject("ProcessID").ToString())
- Owp.OutputString(String.Format("Found the ProcessID: {0}...", PID.ToString))
- Exit For
- End If
- Next
- If PID > 0 Then
- For Each proc In DTE.Debugger.LocalProcesses
- If proc.ProcessID = PID Then
- proc.Attach()
- attached = True
- Exit For
- End If
- Next
- End If
- If Not attached Then
- MsgBox("w3wp.exe with Argument '" + CmdLine + "' is not running!", MsgBoxStyle.Exclamation, "MiKrosok Pisual Studio 2010")
- Else
- Owp.OutputString(String.Format("ProcessID {0} already attached to VS debugger!", PID.ToString))
- Owp.Activate()
- End If
- End Sub
- Private Sub AttachProcess(ByVal ProcessName As String)
- PanelInit()
- Dim attached As Boolean = False
- Dim proc As EnvDTE.Process
- For Each proc In DTE.Debugger.LocalProcesses
- If proc.Name.ToLower().Contains(ProcessName.ToLower()) Then
- proc.Attach()
- attached = True
- Exit For
- End If
- Next
- If Not attached Then
- MsgBox("'" + ProcessName + "' is not running!", MsgBoxStyle.Exclamation, "MiKrosok Pisual Studio 2010")
- Else
- Owp.OutputString(String.Format("ProcessName {0} already attached to VS debugger!", ProcessName))
- Owp.Activate()
- End If
- End Sub
- Public Sub AttachOWSTimer()
- AttachProcess("owstimer.exe")
- End Sub
- Public Sub AttachOSCAR()
- AttachW3WP("SharePoint - 80")
- End Sub
- Public Sub AttachK2WorklistService()
- AttachW3WP("K2WorklistService")
- End Sub
- Public Sub AttachCommonWorkflowServices()
- AttachW3WP("CommonWorkflowServices")
- End Sub
- Public Sub AttachEIS()
- AttachW3WP("SharePoint - 80 - EIS")
- End Sub
- End Module
Hope it helps you.
16 Feb 2013
Backup-Restore Content of SharePoint 2010 Problems
So, I see a different issues coming up when we try to backup-restore content of SharePoint from one server to another. Most commonly issues that I found is that we will stuck on this message:
“Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '4.0.145.0' or later.”
Sometimes it says exact version like above, sometimes with another number of version. To resolve it, there’s more approach that Microsoft has provided.
There are 2 approaches to do a backup-restore of SharePoint content itself:
- SharePoint Site Collection backup.
- SharePoint Content Database backup.
First approach and always be the best approach (I’ve done this many times never fails):
Make sure both destination and source server have to be the exact same version, both in the SharePoint version or SharePoint build number.
With that approach, both solution can be applied. But of course, sometimes we happen to find a different version both on source or destination for some reason. Again, you could compare both versions, which one is higher. If the source is higher than destination, definitely you can’t just do a backup-restore the content straightaway. You need to make destination at least the same version as source. But if the source is lower than destination, on most cases it will just restored without problem.
But, if you notice my last sentence, that doesn’t mean totally without problem. Say you have SharePoint pre-SP1 as a source, and SharePoint with SP1 as a destination. This scenario can’t be done! But why?
That’s a logical question, because normally if the destination is higher version than source, it’ll do just straightaway, but this is not. The reason behind this is just as simple as this, pre-SP1 and SP1 content database structure has a big change and no backward compatibility.
How we are gonna do this? So, there are 2 approaches.
If you do a content-database backup as I said above, your approach will be easier as 1-2-3:
- Attach the pre-SP1 Content Database to an SP1 Farm. This can be done by adding the content database to the specific web application in SharePoint Central Administration.
- You have to run SharePoint Configuration Wizard to update the content database to SP1 version. Or if it’s failed, try run PSConfig command to upgrade it (PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures).
- Detach the upgraded Content Database from that SP1 Farm. This can be done by removing the content database from specific web application in SharePoint Central Administration.
- Recover content as unattached database by running PowerShell command (Get-SPContentDatabase -ConnectAsUnattachedDatabase -DatabaseName <DatabaseName> -DatabaseServer <DatabaseServer>).
But if you only “able” to get the site collection backup file from stsadm or PowerShell (because say some companies are restricting us to do a database backup or it has to go with some crazy procedures), here’s what you need to do (which is painful):
- Restore pre-SP1 site collection backup file to a new test pre-SP1 farm.
- Upgrade the test farm to SP1 until you finished running SharePoint Configuration Wizard.
- Perform a site collection backup from test farm.
- Perform a site collection restore to destination farm.
Any other way would be:
- Restore pre-SP1 site collection backup file to a new test pre-SP1 farm.
- Without upgrading, detach Content Database of test pre-SP1 farm.
- Attach pre-SP1 Content Database to an SP1 Farm.
- Upgrade it by using SharePoint Configuration Wizard or PSConfig as I mentioned above.
- Detach the upgraded Content Database.
- Recover content as unattached Content Database.
Hope it helps, guys….
reference: http://technet.microsoft.com/en-us/library/hh344831(v=office.14).aspx
6 Feb 2013
List of SharePoint Service Accounts
| Account | Category | Account Name | Purpose | Requirements |
| SQL Server Service Account | SQL Server | The SQL Server service account is used to run SQL Server. It is the service account to run SQL Server service, MSSQLSERVER. | > Domain user account. | |
| SQL Server Setup User Account | SQL Server | The Setup user account is used to run SQL Server Setup. | > Domain user account. > Member of the Administrators group on each SQL Server on which Setup is run. | |
| SQL Server Agent Service Account | SQL Server | The SQL Server service account is used to run SQL Server. It is the service account to run SQL Server Agent service, SQLSERVERAGENT. | > Domain user account. | |
| Application Pool Account | SharePoint | The application pool account is used for application pool identity. Recommended action is to make this account specific to each SharePoint Web Application. | > Domain user account. > Registered Managed Accounts in Central Administration. > This account must not be a member of the Farm Administrators group. | |
| Content Access Account | SharePoint | Content access accounts are configured to access content by using the Search administration crawl rules feature. This type of account is optional and you can configure it when you create a new crawl rule. For example, external content (such as a file share) might require this separate content access account. | > Domain user account. > The content access account must have read access to external or secure content sources that this account is configured to access. > For SharePoint Server sites that are not part of the server farm, you have to explicitly grant this account full read permissions to the web applications that host the sites. > This account must not be a member of the Farm Administrators group. | |
| Default Content Access Account | SharePoint | The default content access account is used within a specific service application to crawl content, unless a different authentication method is specified by a crawl rule for a URL or URL pattern. | > Domain user account. > The content access account must have read access to external or secure content sources that this account is configured to access. > For SharePoint Server sites that are not part of the server farm, you have to explicitly grant this account full read permissions to the web applications that host the sites. > This account must not be a member of the Farm Administrators group. | |
| Excel Services Unattended Service Account | SharePoint | Excel Services uses the Excel Services unattended service account to connect to external data sources that require a user name and password that are based on operating systems other than Windows for authentication. If this account is not configured, Excel Services will not attempt to connect to these types of data sources. Although account credentials are used to connect to data sources of operating systems other than Windows, if the account is not a member of the domain, Excel Services cannot access them. | > Domain user account. | |
| My Sites Application Pool Account | SharePoint | The application pool account is used for My Site application pool identity. Recommended action is to make this account specific to each SharePoint Web Application. | > Domain user account. > Registered Managed Accounts in Central Administration. > This account must not be a member of the Farm Administrators group. | |
| Server farm account or database access account | SharePoint | The server farm account is used to perform the following tasks: Configure and manage the server farm, act as the application pool identity for the SharePoint Central Administration Web site, run the Microsoft SharePoint Foundation Workflow Timer Service. | > Domain user account. > Additional permissions are automatically granted for the server farm account on Web servers and application servers that are joined to a server farm. > The server farm account is automatically added as a SQL Server login on the computer that runs SQL Server. The account is added to the following SQL Server security roles: 'dbcreator' fixed server role, 'securityadmin' fixed server role, 'db_owner' fixed database role for all SharePoint databases in the server farm. | |
| Service Application Application Pool Account | SharePoint | The application pool account is used for service application application pool identity. Recommended action is to make this account to be used in all SharePoint Service Application across farm. | > Domain user account. > Registered Managed Accounts in Central Administration. | |
| SharePoint Setup User Account | SharePoint | The Setup user account is used to run the following, SharePoint Setup and SharePoint Products Configuration Wizard. | > Domain user account. > Member of the Administrators group on each SharePoint server on which Setup is run. > SQL Server login on the computer that runs SQL Server. > Member of the following SQL Server roles: 'securityadmin' fixed server role and 'dbcreator' fixed server role. | |
| SharePoint User Profile Service Account | SharePoint | The user account is used to run the User Profile Synchronization service. Configured under User Profile Service Application for a connection to Active Directory. | > Domain user account. > Registered Managed Accounts in Central Administration. > Replicating Directory Changes rights in Active Directory security management. | |
| SharePoint Search Service Account | SharePoint | The user account is used to run the Search Service Application. | > Domain user account. > Registered Managed Accounts in Central Administration. |
6 Jun 2012
Issue for Download File Prompt in SharePoint 2010
OK, so you have the SharePoint 2010, and now you got HTML or HTM file, but when you tried to open the URL to that file, you got a Download File dialog box.
Follow these steps to fix.
Open the SharePoint 2010 Central Administration and then go to Application Management and click Manage web applications.
Highlight the web application you want to fix, and click General Settings.
Change this to Permissive and click OK.
Set Maximum Upload File Size in SharePoint
Simple question, how to set maximum upload file size in SharePoint? Here’s how….
19 Mar 2012
Automatic IIS Configuration Script for SharePoint 2010
Just found out this batch script from Microsoft. Maybe you ever found this solution, but better to share piece by piece than just share the link from Microsoft.
15 Feb 2012
Forefront Identity Manager Service Failed to Start in SharePoint 2010
Did you ever got this when restarting your SharePoint 2010 machine?
Too bad that this thing is always happening every time you restart your SharePoint 2010 machine. Got the answer from a buddy in internet (thanks Michael Hanes, this is really helping me a lot!). I got to tell you, this thing happens after I’ve upgraded my SharePoint development box to Service Pack 1.
This is the simple fix, I hope you’ll find this thing helpful to you by looking at the series of images below. Please ask me anything if it not clear to you. Thanks!
26 Jan 2012
Problems in SharePoint 2010, “The service was unable to start because the version of the database does not match the version of the product.”
Lately, I’ve updated my SharePoint 2010 development engine to SharePoint 2010 Service Pack 1, and after updating SharePoint 2010 to Service Pack 1, and starting all services, there’s one service won’t run, Forefront Identity Manager Synchronization Service. When looked at the Event Viewer log, it says The service was unable to start because the version of the database does not match the version of the product.
19 Jan 2012
How to Query SharePoint Web Analytics Reports from SQL Server
21 Okt 2011
Get All Items including inside SharePoint Folder Programmatically using SPQuery
Just sharing the knowledge, I want to share about how to get all items / documents programmatically without getting inside the folder and querying it again. So, without folders, all items whether inside a folder or not, will be shown upon your query result.
Awwww, I’m not in Windows 2008 mode to copy my code in here and show some screenshots, but that’s just fine.
- SPQuery Q = new SPQuery();
- Q.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>BOOK</Value></Eq></Where>";
- Q.ViewFields = "<FieldRef Name='Name' /><FieldRef Name='ID' />";
- Q.ViewAttributes = "Scope='RecursiveAll'";
After you code your query, then you can add ViewAttributes and add Scope=’RecursiveAll’ to the SPQuery object.
Done, and all items whether inside a folder or not, will be shown upon your query result.
18 Okt 2011
Tools to Get SPSite and SPWeb Aggregation ID for SharePoint 2010
It’s been a busy months for me, I can’t write anything on my spare time. But I tell you what, I’ve created a little tools to generate Aggregation ID so you don’t have to write code about it if you just want to query the Web Analytics on SharePoint 2010.
Just specify your URL and Level, and you’re good to go.
Usage:
Rdz.GetAggregationId.exe –URL <URL of SharePoint Site or SubSite> –Level [SPSite | SPWeb]
Below is the exe file that you can use. It based on .NET 3.5.
UPDATE: Thanks for Anand for noticing. I just realized that I haven’t include the DLL inside the ZIP file yet. Above, is the updated link. Thanks a lot and sorry for my mistake!
20 Jul 2011
Tips for Different FQDN and NetBIOSName in SharePoint 2010 User Profiles
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