To use the SRM
API, you must establish a connection to an SRM server.
Some of the objects returned
by the SRM API are objects from the vSphere API. To use those objects in
integration with the vSphere API through PowerCLI, you can connect to the
vCenter
Server
system that the SRM server is registered with.
Procedure
1 | To connect to the
vCenter
Server
system that the SRM server is registered with, run
Connect-VIServer with
the server name and valid credentials.
Connect-VIServer -Server vc3.example.com -User 'MyAdministratorUser' -Password 'MyPassword'
|
2 | To connect to the SRM
server registered with the connected
vCenter
Server
system, run
Connect-SrmServer.
$srm = Connect-SrmServer
Note
If you have
previously connected to other
vCenter
Server
systems configured with SRM server support, this cmdlet invocation establishes
a connection to their corresponding SRM servers as well.
|
3 | (Optional) To use the SRM API, you
can call methods of the root object and instances of the objects that those
calls return.
$srmApi = $srm.ExtensionData
Note
The root SRM API
object is the
ExtensionData property of the
SrmServer object.
|