Share via


Get-SCLibraryShare

Gets VMM library shares.

Syntax

Default (Default)

Get-SCLibraryShare
    [-VMMServer <ServerConnection>]
    [-ID <Guid>]
    [-OnBehalfOfUser <String>]
    [-OnBehalfOfUserRole <UserRole>]
    [<CommonParameters>]

Description

The Get-SCLibraryShare cmdlet gets Virtual Machine Manager (VMM) library shares.

A library share is a Windows share on a VMM library server that is used to store files that contain library resources. Resources can include virtual machine templates, hardware profiles, guest operating system profiles, virtual hard disks (Windows-based .vhd files, Citrix XenServer-based .vhd files or VMware-based .vmdk files), virtual floppy disks (Windows-based .vfd files or VMware-based .flp files), ISO images (.iso files), and scripts, as well as stored virtual machines.

For more information about library shares, type Get-Help Add-LibraryShare -Detailed.

Examples

Example 1: Get all library shares

PS C:\> Get-SCLibraryShare -VMMServer "VMMServer01.Contoso.com"

This command gets all library share objects from the VMM library on VMMServer01 and displays information about these library shares to the user.

Example 2: Get a specific library share on the specified library server

PS C:\> $LibShare = Get-SCLibraryShare -VMMServer "VMMServer01.Contoso.com" | where { $_.LibraryServer.Name -eq "LibraryServer01.Contoso.com" -and $_.Name -eq "AllVHDs" }

This command gets the library share object named AllVHDs (on library server LibraryServer01) from the library on VMMServer01 and then stores the share object in the $LibShare variable.

Example 3: Get all library shares on a specific library server

PS C:\> $LibServer = Get-SCLibraryServer -VMMServer "VMMServer01.Contoso.com" -ComputerName "LibraryServer01.Contoso.com"
PS C:\> $AllLibShares = Get-SCLibraryShare | where { $_.LibraryServer.Name -eq "$LibServer" }
PS C:\> $AllLibShares | Get-Member

The first command retrieves the library server object named LibraryServer01 from the library on VMMServer01 and stores it in the $LibServer variable.

The second command gets all library share objects on LibraryServer01 and stores the objects in the $AllLibShares variable.

The last command passes each object in $AllLibShares to the Get-Member cmdlet, which displays the .NET type for a library share object and the list of methods and properties that are associated with a VMM library share object.

Parameters

-ID

Specifies the numerical identifier as a globally unique identifier, or GUID, for a specific object.

Parameter properties

Type:Guid
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

-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

-VMMServer

Specifies a 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

LibraryShare

This cmdlet returns a LibraryShare object.