Get-SCSharedResource

Applies To: System Center 2012 - Virtual Machine Manager

Get-SCSharedResource

Gets resources that are shared with a self-service user or a self-service user role.

Syntax

Parameter Set: Default
Get-SCSharedResource [-UserName <NTAccount> ] [-UserRole <UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed Description

The Get-SCSharedResource gets resources that are shared with a self-service user or a self-service user role.

For more information about Get-SCSharedResource, type: "Get-Help Get-SCSharedResource -online".

Parameters

-UserName<NTAccount>

Specifies a the name of a user. Enter a user name with the format Domain\User.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UserRole<UserRole>

Specifies a user role object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • SharedResource

Examples

1: Get all resources that are shared with a specific self-service user.

This command returns all resources that are shared to the user named Katarina.

PS C:\> Get-SCSharedResource -UserName "Contoso\Katarina"

2: Get all resources that are shared with a specific self-service user role.

The first command gets the user role object named ContosoSelfServiceUsers and stores the object in the $Role variable.

The second command returns the resources that are shared to the user role stored in $Role (ContosoSelfServiceUsers).

PS C:\> $Role = Get-SCUserRole -Name "ContosoSelfServiceUsers"
PS C:\> Get-SCSharedResource -UserRole $Role

3: Get all resources that are shared with a specific user in a specific user role.

The first command gets the user role object named ContosoSelfServiceUsers and stores the object in the $Role variable.

The second command returns the resources that are shared with the user named Katarina in the user role stored in $Role (ContosoSelfServiceUsers).

PS C:\> $Role = Get-SCUserRole -Name "ContosoSelfServiceUsers"
PS C:\> Get-SCSharedResource -UserName "Contoso\Katarina" -UserRole $Role

Grant-SCResource

Revoke-SCResource