Skip to main content
SnapCenter 6.0 cmdlets

Add-SmResourceToUser

Contributors

Adds resources to an existing user.

Syntax

Add-SmResourceToUser [-UserName]  <String>  [-ResourceNames]  <String>  [-ResourceType]  <OperationAssignmentType>  [-UserGroupObjectType]  <SmUserGroupObjectType>

Detailed Description

Adds resources to an existing user. The resources can be a resource group, credential, host, policy, storage connection or plug-in.

Parameters

Name Description Required? Pipeline Input Default Value

UserName

Name of the domain\user.

true

true (ByPropertyName)

ResourceNames

Name of the resources to be assigned. You can use a comma to separate multiple resources.

false

true (ByPropertyName)

ResourceType

The type of resource being added to the user. Possible values are Credential, StorageConnection, Policy, Plugin, Host, and ResourceGroup.

true

true (ByPropertyName)

UserGroupObjectType

Specifies that the domain\username to which you are adding a resource is a group.

false

true (ByPropertyName)

Examples

Example 1: Adding a host resource to an user

 Add-SmResourceToUser -UserName sddev\administrator -ResourceNames clab-a13-13.sddev.mycompany.com -ResourceType Host

This example syntax assigns a host resource to the user.

Example 2: Adding a resource group to an user

 Add-SmResourceToUser -UserName sddev\administrator -ResourceNames FinanceResourceGroup -ResourceType ResourceGroup

This example syntax assigns the FinanceResourceGroup resource group to the sddev\administrator user.

Example 3: Adding an credential to an user

 Add-SmResourceToUser -UserName sddev\administrator -ResourceNames Cred_1 -ResourceType Credential

This example syntax assigns the Cred_1 credential resource to the sddev\administrator user.

Example 4: Adding a policy to an user

 Add-SmResourceToUser -UserName sddev\administrator -ResourceNames testPol -ResourceType Policy

This example syntax assigns the testPol policy resource to the sddev\administrator user.

Example 5: Adding a storage connection to an user

 Add-SmResourceToUser -UserName sddev\administrator -ResourceNames svm1 -ResourceType StorageConnection

This example syntax assigns the svm1 storage connection resource to the sddev\administrator user.

Example 6: Adding all the resources to an user

 Add-SmResourceToUser -UserName sddev\administrator -ResourceType All

This example syntax assigns all the resources to the sddev\administrator user.