Difference between revisions of "Script Extracts and Examples (PowerCLI)"

Jump to navigation Jump to search
m
→‎Getting Started: Added https://server/mob link
m (→‎Getting Started: Added note regarding run as admin on newer OS's)
m (→‎Getting Started: Added https://server/mob link)
Line 8: Line 8:
  Set-ExecutionPolicy RemoteSigned
  Set-ExecutionPolicy RemoteSigned


Connect to the Virtual Centre using the following command using your normal username and password (same as you'd use to log into the VI Client).  You will need access to the servers on TCP 443.
Connect to the Virtual Centre (or ESX) server using the following command using your normal username and password (same as you'd use to log into the VI Client).  You will need access to the servers on TCP 443.
  Connect-VIServer -Server uklonvcp1 -User <user> -Password <pass>
  Connect-VIServer -Server <server> -User <user> -Password <pass>
 
Once connected you can do real work with the PowerCLI, to see what's available, login to https://server/mob.  This is effectively where you end up once you've completed the <code> Connect-VIServer </code> command.


Be aware that PowerShell commands generally return objects, rather than text, and that the textual representation of the return object is often abbreviated for simplicity.  To see the entire return for a command, pipe the result into <code>Format-List</code>.  To complicate matters further, some return objects contain further objects, see examples below
Be aware that PowerShell commands generally return objects, rather than text, and that the textual representation of the return object is often abbreviated for simplicity.  To see the entire return for a command, pipe the result into <code>Format-List</code>.  To complicate matters further, some return objects contain further objects, see examples below

Navigation menu