Get-SCSharedResource
Get-SCSharedResource
Gets resources that are shared with a self-service user or a self-service user role.
Syntax
Parameter Set: Default
Get-SCSharedResource [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-UserName <NTAccount> ] [-UserRole <UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
Detailed Description
The Get-SCSharedResource cmdlet gets resources that are shared with a self-service user or a self-service user role.
Parameters
-OnBehalfOfUser<System.String>
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-OnBehalfOfUserRole<Microsoft.SystemCenter.VirtualMachineManager.UserRole>
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-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 (https://go.microsoft.com/fwlink/p/?LinkID=113216).
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
Example Example 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"
Example 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 then stores the object in the $Role variable.
The second command returns the resources that are shared to the user role stored in $Role.
PS C:\> $Role = Get-SCUserRole -Name "ContosoSelfServiceUsers"
PS C:\> Get-SCSharedResource -UserRole $Role
Example 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 then 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.
PS C:\> $Role = Get-SCUserRole -Name "ContosoSelfServiceUsers"
PS C:\> Get-SCSharedResource -UserName "Contoso\Katarina" -UserRole $Role