Add-SCLibraryServer

Adds a computer as a library server to VMM.

Description

The Add-SCLibraryServer cmdlet adds one or more computers as library servers to System Center 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 VMM library server system requirements, see "System Requirements: VMM Library Server" in the TechNet Library at http://go.microsoft.com/fwlink/?LinkID=213754.

When you add a ocmputer 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 portion of the VMM database that stores 
  objects that represent all library resources.

- LIBRARY RESOURCE FILES. Files that 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.

For more information about Add-SCLibraryServer, type: "Get-Help Add-SCLibraryServer -online".

Parameters

ComputerName

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies the name of a computer that VMM can uniquely identify on your network. Valid formats are: FQDN, IPv4 or IPv6 address, or NetBIOS name.

NOTE: See the examples for a specific cmdlet to determine how that cmdlet specifies the computer name.

Credential

Required? true
Accept Pipeline Input? false
Position? named
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".

Description

Required? false
Accept Pipeline Input? false
Position? named
States a description for the specified object.

EnableUnencryptedFileTransfer

Required? false
Accept Pipeline Input? false
Position? named
Indicates, when set to True, that 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.

JobGroup

Required? false
Accept Pipeline Input? false
Position? named
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. 

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VMHostGroup

Required? false
Accept Pipeline Input? false
Position? named
Specifies a virtual machine host group object.

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Examples

1: Add a library server.
PS C:\> $Creds = Get-Credential
PS C:\> Add-SCLibraryServer -VMMServer "VMMServer01.Contoso.com" -ComputerName "LibraryServer01.Contoso.com" -Credential $Creds -RunAsynchronously
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 second command adds the library server object named LibraryServer01 to the library on VMMServer01.  
2: Add a highly available file server with two nodes as a library server.
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
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, this is represented by \\HAFIleServer01.Contoso.com\LibShare).

The first command uses Get-Credential to prompt you to supply a user name and password and 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 stores the cluster object in the $Cluster variable.

The third command uses a foreach loop 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".

See Also