none
Powershell script FIM Schema RRS feed

  • Question

  • Hello , 

    i'am looking for a powershell Script permetting to create the attributs and bindings in FIM from a CSV file ? 

    Thanks 

    Wednesday, May 22, 2013 4:19 PM

Answers

  • Yes, in fact "Local" is not an attribute.

    You need to extend New-FimImportObject function to add another parameter to achieve that like:

     

    New-FimImportObject -ObjectType AttributeTypeDescription -State Create -Uri $uri -Changes @{
    		DisplayName = $DisplayName
    		Name		= $Name
    		DataType	= $DataType
    		Multivalued	= $Multivalued
            Description	= $Description
    		
    	} -ApplyNow -Localized @{ DisplayName = "fr-fr:DisplayName" }

    I will let you find the code to inside the New-FimImportObject becase it's quit similar to the Change :)

    (Think to split the "value" to get language and value)

     


    Sylvain

    • Marked as answer by gentelman Friday, May 24, 2013 11:55 AM
    Friday, May 24, 2013 8:44 AM

All replies

  • If you use the Module available at fimpowershellmodule.codeplex.com, this should be very easy. You'll want to look at the New-FimSchemaAttribute and New-FimSchemaBinding cmdlets in conjunction with Import-Csv.

    My Book - Active Directory, 4th Edition
    My Blog - www.briandesmond.com

    Wednesday, May 22, 2013 8:47 PM
    Moderator
  • Ok thank you, but how can i set the localized language for the each attribute
    Thursday, May 23, 2013 7:25 AM
  • We don't currently support that in the cmdlet. Start with the underlying New-FimImportObject call in the cmdlet code and add the attributes for localization. Offhand, I don't know what they're called.

    My Book - Active Directory, 4th Edition
    My Blog - www.briandesmond.com

    Thursday, May 23, 2013 7:27 AM
    Moderator
  • i had found the attribut LocalizedDisplayName but how can specify the language !!!
    Thursday, May 23, 2013 2:03 PM
  • I normally find things out by setting values in FIM portal and using powershell to read that value. That way you can find the exact value to set.


    Regards Furqan Asghar

    Thursday, May 23, 2013 3:59 PM
  • Hello,

    It's quit simple in fact:

    If you are using the fimpowershellmodule.codeplex.com module

    $importObject.Changes += New-FimImportChange -Uri $Uri -AttributeName "DisplayName" -AttributeValue "Test" -Operation Replace -Locale "fr-fr"


    Sylvain

    Thursday, May 23, 2013 4:34 PM
  • I should to create the attribut then update it ? Is there a complete exemple of creating an attribut with localized valeur Thanks
    Thursday, May 23, 2013 8:59 PM
  • No, you can specify both "unlocalized" and localized values when you create your attribute.


    Sylvain

    Friday, May 24, 2013 7:38 AM
  • function New-FimSchemaAttribute
    {
      	param
       	(
       		$Name, 
    		$DisplayName, 
    		$DataType,
    		$Multivalued = 'false',
            $Description = $Name,
            <#
    	    .PARAMETER Uri
    	    The Uniform Resource Identifier (URI) of themmsshortService. The following example shows how to set this parameter: -uri "http://localhost:5725"
    	    #>
    	    [String]
    	    $Uri = "http://localhost:5725"
    
       	)     
        New-FimImportObject -ObjectType AttributeTypeDescription -State Create -Uri $uri -Changes @{
    		DisplayName = $DisplayName
    		Name		= $Name
    		DataType	= $DataType
    		Multivalued	= $Multivalued
            Description	= $Description
    		Locale = "Fr-Fr"
    		
    	} -ApplyNow
    } 

    I'am using this function but i have this error 

    

    Any idea??

    Friday, May 24, 2013 8:18 AM
  • Yes, in fact "Local" is not an attribute.

    You need to extend New-FimImportObject function to add another parameter to achieve that like:

     

    New-FimImportObject -ObjectType AttributeTypeDescription -State Create -Uri $uri -Changes @{
    		DisplayName = $DisplayName
    		Name		= $Name
    		DataType	= $DataType
    		Multivalued	= $Multivalued
            Description	= $Description
    		
    	} -ApplyNow -Localized @{ DisplayName = "fr-fr:DisplayName" }

    I will let you find the code to inside the New-FimImportObject becase it's quit similar to the Change :)

    (Think to split the "value" to get language and value)

     


    Sylvain

    • Marked as answer by gentelman Friday, May 24, 2013 11:55 AM
    Friday, May 24, 2013 8:44 AM