次の方法で共有


Add-SCLibraryServer

Add-SCLibraryServer

Adds a computer as a library server to VMM.

Syntax

Parameter Set: Default
Add-SCLibraryServer [-ComputerName] <String> -Credential <VMMCredential> [-Description <String> ] [-EnableUnencryptedFileTransfer <Boolean]> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed Description

The Add-SCLibraryServer cmdlet adds one or more computers as library servers to Virtual Machine Manager (VMM). For a computer to be a library server, it must be in the same domain as, or in a trusted domain with, the VMM server. For information about VMM library server system requirements, see System Requirements: VMM Library Server (https://go.microsoft.com/fwlink/?LinkID=213754) in the TechNet Library.

When you add a computer as a library server to VMM, VMM automatically installs the Virtual Machine Manager Agent software on that server.

The VMM library is made up of two primary components:

-- Library. The library is the portion of the VMM database that stores objects that represent all library resources.
-- Library resource files. Library resource files are stored in library shares on one or more physical library servers. Library resources can be distributed across multiple physical library servers. Some library objects have files and others do not.

VMM library resources 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. In addition, you can store virtual machines in the library that you do not want deployed on a host.

Of these resources, templates, hardware profiles, and guest operating system profiles are represented only by objects stored in the library. The other resources are files stored in the file system on library servers and objects that correspond to those files stored in the library.

Parameters

-ComputerName<String>

Specifies the name of a computer that VMM can uniquely identify on your network. Valid formats are:

-- FQDN
-- IPv4 or IPv6 address
-- NetBIOS name

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Credential<VMMCredential>

Specifies a credential object or, for some cmdlets, a Run As account object that contains the user name and password of an account that has permission to perform this action. Or, in the case of Restart-SCJob, has permission to complete a restarted task.

For more information about the PSCredential object, type Get-Help Get-Credential.

For more information about Run As accounts, type Get-Help New-SCRunAsAccount.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Description<String>

States a description for the specified object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EnableUnencryptedFileTransfer<Boolean]>

Indicates whether network file transfers do not require encryption. Allowing unencrypted network file transfers can improve performance if neither the source host nor the destination host requires encryption.

Use this parameter to:

-- Enable unencrypted file transfers into, or out of, the library.
-- Enable unencrypted file transfers into, out of, or within a host group.

Aliases

AllowUnencryptedTransfers

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobGroup<Guid]>

Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobVariable<String>

Specifies that job progress is tracked and stored in the variable named by this parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid]>

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMHostGroup<HostGroup>

Specifies a virtual machine host group object.

Aliases

LibraryGroup

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

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.

  • LibraryServer

Examples

Example 1: Add a library server

The first command prompts you for credentials. When the dialog box appears, type the user name and password for either a local Administrator account or a domain account with administrator rights on the library server. The command stores the credentials in the $Creds variable. For more information, type Get-Help Get-Credential.

The second command adds the library server object named LibraryServer01 to the library on VMMServer01.

PS C:\> $Creds = Get-Credential
PS C:\> Add-SCLibraryServer -VMMServer "VMMServer01.Contoso.com" -ComputerName "LibraryServer01.Contoso.com" -Credential $Creds -RunAsynchronously

Example 2: Add a highly available file server with two nodes as a library server

This example assumes the following: you have created a cluster with at least two nodes, you have created a highly available file server, and you have created a share on the highly available file server. In this example, the share is \\HAFIleServer01.Contoso.com\LibShare.

The first command uses Get-Credential to prompt you to supply a user name and password, and then stores your credentials in $Credential. The required credentials for this operation are a domain account with administrator rights on each node of a failover cluster hosting the highly available file server that you want to add to VMM.

The second command uses the Find-SCCluster cmdlet to confirm that HAFileServer01 is a highly available file server, and then stores the cluster object in the $Cluster variable.

The third command uses a ForEach statement to pass each cluster node to Add-SCLibraryServer, which adds the nodes as library servers. For more information about the Windows PowerShell ForEach loop statement, type: Get-Help about_ForEach.

The fourth command uses Add-SCLibraryServer to add the highly available file server named HAFileServer01 to VMM as a library server.

The last command uses Add-SCLibraryShare to add the specified share on the highly available file server. For more information about adding library shares, type Get-Help Add-SCLibraryShare.

PS C:\> $Credential = Get-Credential
PS C:\> $Cluster = Find-SCCluster -ComputerName "HAFileServer01.Contoso.com" -Credential $Credential
PS C:\> ForEach ($Node in $Cluster.ClusterNodes) { Add-SCLibraryServer -ComputerName $Node -Credential $Credential}
PS C:\> Add-SCLibraryServer -ComputerName "HAFileServer01.Contoso.com" -Credential $Credential
PS C:\> Add-SCLibraryShare -SharePath "\\HAFileServer01.Contoso.com\LibShare" -Credential $Credential

Add-SCLibraryShare

Find-SCCluster

ForEach-Object

Get-SCLibraryServer

Get-SCVMMServer

Remove-SCLibraryServer

Restart-SCJob

Set-SCLibraryServer