Get-SCSharedResource
Gets resources that are shared with a self-service user or a self-service user role.
Syntax
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.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserRole
Specifies a user role object.
Type: | UserRole |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMMServer
Specifies a Virtual Machine Manager (VMM) server object.
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Outputs
SharedResource
This cmdlet returns a SharedResource object.