Add-PSSnapin "microsoft.sharepoint.powershell"
#Connect to the Metadata Service
$taxSite = get-SPSite "CentralAdminURL"    # Central Admin URL   
$taxonomySession = Get-SPTaxonomySession -site $taxSite
$termStore = $taxonomySession.TermStores["MetadataServiceName"] # Meta data service name
#Create a group
$termGroup = $termstore.CreateGroup("NewTermGroup") # New group 

#Connect to existing term group
$termGroup = $termstore.groups["NewTermGroup"];

#Create a term set
$termSet = $termGroup.CreateTermSet(“Skills”)

#Connect to existing term set
$termset = $TermGroup.Termsets["Skills"]

#Adding a default term to term set
$term = $termSet.CreateTerm("Sea wall",1033)
$term.SetDescription(“Sea wall”, 1033)
$term.CreateLabel("Seawall”, 1033, $false)

$TermSet.IsOpenForTermCreation = $true;

# Contribute permission on term group (This statement raising error)
$user = "c:0(.s|true"

# Contribute permission on term group   (This statement raising error)



Exception calling "AddContributor" with "1" argument(s): "The user name 'ec\everyone' can not be found. Parameter name: principalName" At line:11 char:1 + $termGroup.AddContributor("Domain\everyone") + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : ArgumentException

  • Is this 2010 or 2013? What type of authentication do you use? The "Everyone" loginname differs depending on those two factors Jun 18 '14 at 9:20
  • We are using windows authentication.Requirement is by using custom user profile property every user can add a term to term set.
    – Ganesha
    Jun 19 '14 at 5:25
  • Is it 2010 or 2013? Jun 19 '14 at 5:33
  • yes it is in 2013.
    – Ganesha
    Jun 19 '14 at 5:53
  • 1
    So it is claim to windows you are using? The way we get the "Everyone" user in code is web.EnsureUser("c:0(.s|true"); where "c:0(.s|true" actually is the claims token for "All users" Jun 19 '14 at 6:03

The error is coming from the argument passed with AddContributor. The string to be passed should be the login name of a user, not a path. Cycle through the actual users of your site, and add each user individually to the term group.

Here are some references to take a look at to understand it better.




The second one that raises error can be solved by removing the escape character: "\", because it causes an error in PowerShell. So here is the working code:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.