Share via


Get-SCSharedResource

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

Syntax

Default (Default)

Get-SCSharedResource
    [-VMMServer <ServerConnection>]
    [-UserName <NTAccount>]
    [-UserRole <UserRole>]
    [-OnBehalfOfUser <String>]
    [-OnBehalfOfUserRole <UserRole>]
    [<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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:UserRole
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-UserName

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

Parameter properties

Type:NTAccount
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-UserRole

Specifies a user role object.

Parameter properties

Type:UserRole
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-VMMServer

Specifies a Virtual Machine Manager (VMM) server object.

Parameter properties

Type:ServerConnection
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

SharedResource

This cmdlet returns a SharedResource object.