Share via


Get-SCVMMServer

Applies To: System Center 2012 - Virtual Machine Manager

Get-SCVMMServer

Connects to a VMM management server if a connection does not already exist, or connects to a different VMM management server.

Syntax

Parameter Set: Default
Get-SCVMMServer [-ComputerName] <String> [-ConnectAs <Profile> ] [-Credential <PSCredential> ] [-RetainDeletedObjects] [-RetainObjectCache] [-SetAsDefault] [-TCPPort <Int32> ] [-UserRoleName <String> ] [ <CommonParameters>]

Detailed Description

The Get-SCVMMServer cmdlet connects to a System Center Virtual Machine Manager (VMM) management server if a connection does not already exist and retrieves the server object from the VMM database. The default port used to connect to a VMM server is TCP port 8100.

If you have created a connection to a VMM management server using the user interface (UI), when you open a VMM command shell, that command shell automatically connects to the same VMM management server. If you have not previously connected to the VMM managment server using the UI, you need to use Get-SCVMMServer to establish a connection. Note that if you connect to a VMM management server only using the VMM command shell, you will need to use the SetAsDefault parameter to retain the connection from session to session, or re-connect to the VMM server each time you open a new VMM command shell session.

You can also use Get-VMMServer to connect to a different VMM management server.

After a connection to the VMM management server is established, all future commands run at the VMM command shell command line that require the VMM server object will automatically use the existing connection until you close that VMM command shell window.

The VMM service running on the VMM management server supports the VMM database. This database is stored in Microsoft SQL Server either on the VMM management server itself or on a separate server running SQL Server.

The VMM service enables you to manage your virtual environment, including host servers (which host virtual machines), library servers (which store VMM library resources), and virtual machines deployed on a host or stored in the library.

For more information about connecting to the VMM management server, type: "Get-Help about_VMM_2012_Connecting_to_the_VMM_Server".

For more information about Get-SCVMMserver, type: "Get-Help Get-SCVMMServer -online".

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, or NetBIOS name.

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

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ConnectAs<Profile>

Specifies the VMM user role to use, if the user is a member of more than one role, when connecting to the VMM management server from the VMM command shell. Valid values are: Administrator, DelegatedAdmin, ReadOnlyAdmin, SelfServiceUser.

VMM Administrators can manage all VMM objects. Delegated administrators and self-service users can access and change only the objects that are within the scope of their user roles. Read-Only administrators can only view the properties of existing objects; they cannot create new objects or change the properties of existing objects.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Credential<PSCredential>

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?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RetainDeletedObjects

Specifies that objects in the cache that are marked for deletion will be preserved. You might need this parameter only if you create a user interface on top of the VMM command shell.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RetainObjectCache

Specifies that the objects in the cache will remain in memory and will not be reclaimed by garbage collection. You might need this parameter if you create a user interface on top of the VMM command shell.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SetAsDefault

Indicates, when set to $True, that the VMM command shelll connects to the specified VMM management server for this session and retains that connection for future sessions.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TCPPort<Int32>

Specifies a numeric value that represents a TCP port.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UserRoleName<String>

Specifies the name of a user role. Types of user roles that are named include Delegated Administrator, Read-Only Administrator and Self-Service User.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

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.

Examples

1: Connect to a VMM server.

This command connects to the VMM server named VMMServer01 located in the Contoso domain and gets the server object from the VMM database.

PS C:\> Get-SCVMMServer -ComputerName "VMMServer01.Contoso.com"

2: Connect to a VMM server through a specific port.

This command connects over TCP port 8100 to the VMM server named VMMServer01 located in the Contoso domain.

PS C:\> Get-SCVMMServer -ComputerName "VMMServer01.Contoso.com" -TCPPort 8100

3: Connect to a VMM server and get its .NET object type, methods, and properties.

The first command gets the VMM server object named VMMServer01 and stores the object in the $VMMServer variable.

The second command passes the VMM server object stored in $VMMServer to the Get-Member cmdlet, which retrieves and displays the following:

- TypeName: The name of the .NET type of the VMM server object:

Microsoft.SystemCenter.VirtualMachineManager.Remoting.ServerConnection

- MemberType: A list containing the name and definition for each event,

method, and property associated wtih this object type.

The third command retrieves and displays the same information as the second command, except that it pipes the output to the Format-List cmdlet so that the complete definition for each method and each property for the VMM server object is displayed.

PS C:\> $VMMServer = Get-SCVMMServer -ComputerName "VMMServer01.Contoso.com"
PS C:\> $VMMServer | Get-Member
PS C:\> $VMMServer | Get-Member | Format-List

4: Connect to a different VMM server with a different user role.

This command connects to the VMM server named VMMServer02 located in the Contoso domain using the DelegatedAdmin user role.

PS C:\> Get-SCVMMServer -ComputerName "VMMServer02.Contoso.com" -ConnectAs "DelegatedAdmin"

Set-SCVMMServer