CreateGroup

This is an example of a Windows PowerShell function that creates a new group in the Forefront Identity Manager (FIM) Service database. For more information, see FIM Windows PowerShell Cmdlet Examples.

CreateGroup Function

This function creates a new ImportObject object based on a Group resource type. It then uses the SetSingleValue function to add attributes to the object based on the function parameters. The new Group is added to the FIM Service database using the Import-FIMConfig cmdlet.

You can use the CreateGroup function as a helper function to other functions that use fewer parameters, as the CreateDistributionGroup and CreateSecurityGroup example functions demonstrate.

CreateDistributionGroup Function

This following example function creates a new ImportObject object based on a Group resource type. It then uses the SetSingleValue function to add attributes to the object based on the function parameters. The new Group is added to the FIM Service database using the Import-FIMConfig cmdlet.

The following example uses the same parameters as the CreateGroup function, except that it does not include the GroupType parameter. The function passes its parameters to the CreateGroup function, but it sets GroupType to "Distribution".

CreateSecurityGroup Function

The following example function uses the same parameters as the CreateGroup function, except that it does not include the GroupType parameter. The function passes its parameters to the CreateGroup function, but it sets GroupType to "Security".