Hi,
Need some help ..
I use RDM to admin a bunch of VMware systems, and it's really good at putting all the 'tools' in one place.
SSH to the vCenter appliance, Web browser to the vCenter interface, SSH to the ESXs .. etc etc ..
Quite a lot of the time I need to open up a PowerShell session (with the PowerCLI add-ins) to the vCenter.
So ... the usual procedure is:
1. Open PowerShell (as of new version of PowerCLI, they no longer ship a client/app as per se; just the add-in).
2. Connect to the vCenter with Connect-VIServer
3. Run my commands as neeeded.
Now, the computer I am on is not joined to the domain the vCenter is connected to, and I've found the easiest way is to cache a Credential.
i.e. $Cred = Get-Credential ; Connect-VIServer -Server <vCenter> -Credential $Cred
Is there a way I can create a PowerShell/PowerCLI 'session', and use a Credential from my Credential Repository ?
I could write an initialization script to take variables etc, I just need to know how to make the 'session' part work.
Thanks
Hello Ivan,
it's possible with a Powershell session - you can use the Embedded Script to set upt the login and your additional commands.
For the login you can use Connect-VIServer $HOST$ -User $USERNAME$ -Password $PASSWORD$
If you want to link the Powershell session to a credential entry, please make sure that the option "Allow password variable"
(Powershell => Security & Credential Entry => Advanced) is enabled
With the mentioned command you should be able to connect to your host. More informations about you'll find here and here
Regards,
Min
OK .. That kinda works .. But I see that RDM only has either PowerShell version 1 or 2 listed.
PowerShell is already upto version 5 now, and the newer version of PowerCLI needs at least version 3.
>From system PowerShell
PS C:\Users\Ivan> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 17134 407
> Trying to use the PowerCLI 10 Module
PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Import-Module C:\Users\Ivan\Documents\WindowsPowerShell\Modules\VMware.PowerCLI\10.2.0.9372002\VMware.PowerCLI.psd1
Import-Module : The version of the loaded PowerShell is '2.0'. The module 'C:\Users\Ivan\Documents\WindowsPowerShell\Modules\VMware.PowerCLI\10.2.0.9372002\VMware.PowerCLI.psd1' requires a mi
nimum PowerShell version of '3.0' to execute. Please verify the installation of the PowerShell and try again.
At line:1 char:14
+ Import-Module <<<< C:\Users\Ivan\Documents\WindowsPowerShell\Modules\VMware.PowerCLI\10.2.0.9372002\VMware.PowerCLI.psd1
+ CategoryInfo : ResourceUnavailable: (C:\Users\Ivan\D...e.PowerCLI.psd1:String) [Import-Module], InvalidOperationException
+ FullyQualifiedErrorId : Modules_InsufficientPowerShellVersion,Microsoft.PowerShell.Commands.ImportModuleCommand
Hello,
RDM doesn't have a own Powershell, it will used the local installed - so the version is the same.
Can you open the Powershell from RDM (Tools => PowerShell (RDM CmdLet) ) and run the Get-Module VM* -ListAvailable command?
If the PowerCLI module is not listed, please read the Troubleshooting VMWare article here
Also I suggest to configure a VMware Console session to check if everything works properly
Regards,
Min