Get-SCSharedResource

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

Syntax

Get-SCSharedResource [-OnBehalfOfUser <String>] [-OnBehalfOfUserRole <UserRole>] [-UserName <NTAccount>]
 [-UserRole <UserRole>] [-VMMServer <ServerConnection>] [<CommonParameters>]

Description

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

Examples

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

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

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

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

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

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

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

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

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

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

The second command returns the resources that are shared with the user named Daugherty in the user role stored in $Role.

Parameters

-OnBehalfOfUser

Specifies a user name. This cmdlet operates on behalf of the user that this parameter specifies.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OnBehalfOfUserRole

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Type:UserRole
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UserName

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

Type:NTAccount
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UserRole

Specifies a user role object.

Type:UserRole
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMMServer

Specifies a Virtual Machine Manager (VMM) server object.

Type:ServerConnection
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Outputs

SharedResource

This cmdlet returns a **SharedResource** object.