in bulk license with PowerCLI 6.0 Release 2 broken?

Hello

I upgraded successfully to PowerCLI 6.0 Release 1 to PowerCLI 6.0 Release 2.

After that, I wanted to add a new license to the license in bulk newly deployed ESXi Hosts with Auto deploy but encountered the following error:

$licenseData = new-Object VMware.VimAutomation.License.Types.LicenseData

New-Object: cannot find type [VMware.VimAutomation.License.Types.LicenseData]: check that the assembly containing this type is loaded.

On line: 1 char: 16

+ $licenseData = new-Object VMware.VimAutomation.License.Types.LicenseData

+                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo: InvalidType: (:)) [New-Object], PSArgumentException)

+ FullyQualifiedErrorId: TypeNotFound, Microsoft.PowerShell.Commands.NewObjectCommand

I'm sure that it worked with PowerCLI 6.0 Release 1.

Did someone else run into it as well? Perhaps no work around?

I appreciate your help.

see you soon,

Ronny

Hello

It is a backward compatibility problem that was introduced in PowerCLI 6.0R2. It will be addressed in a version of the next patch very soon, but until then, you can work around

replacement of

'VMware.VimAutomation.License.Types.LicenseData '.

with

'VMware.VimAutomation.License.Types.V1.LicenseData '.

Keep in mind that if you do the above to make your script works and later upgrade your PowerCLI to a version more recent that you should check back this change in scripts.

-Dimitar Milov

Tags: VMware

Similar Questions

  • The availability of license with PowerCLI

    I'm currently collecting each host license use, but want to collect total and available on the license server licenses.  I can't see how it's done using the Perl Toolbox, but can't figure out in PowerShell.  Basically, I want the same use license information in this perl script: http://communities.vmware.com/docs/DOC-9420.

    However, when I try to use the QueryLicenseSourceAvailability method, nothing is returned.  If I have access to the object browser on the host of the VC (https://vc-host/mob), it returns the info.

    Is this a limitation of the powershell tool or did I miss something?

    Thank you

    -J

    Have you had a glance at the Hugo's blog ?

  • Complete the VI Client with PowerCLI Script idle Sessions

    Hello gurus PowerCLI

    I searched the net for a script PowerCLI that would end all the VI client sessions that have been inactive for x period of time.  I found a post on the forums of VMware (http://communities.vmware.com/message/914858?z=zI0r8n) but had no luck with it.  I also found a script created by A.Mikkelsen, to http://www.amikkelsen.com/?p=384 , but that one does not work either.

    Here's the actual script by A.Mikkelsen that is based on code by LucD in the forum mentioned previously.

    BEGINNING

    ##################################################################################
    # The script terminates all sessions if idle idle user for more than xx #.
    #                             #
    # Created by: Anders Mikkelsen, 2010 #.
    ##################################################################################
    Claire
    # Add - PSSnapin VMware.VimAutomation.Core

    # $server = "vcenter server.
    # $user = "vcenter username.
    # $pwd = "password of vcenter.

    # Add 1 extra hour when, due to the difference of timestamp between MSSQL and Windows.
    # slow down time 5 hours = 360
    # 10 hours slowed = 660
    $intOlderThan = 60

    # Connect-VIServer $server - user $user-password $pwd
    # Connect-VIServer $server

    $svcRef = new-object VMware.Vim.ManagedObjectReference
    $svcRef.Type = 'ServiceInstance.
    $svcRef.Value = 'ServiceInstance.
    $serviceInstance = get-views $svcRef

    $sessMgr = get-view $serviceInstance.Content.sessionManager
    $oldSessions = @)
    {foreach ($sess in $sessMgr.SessionList)}
    If (($sess.)) (LastActiveTime) .addminutes ($intOlderThan) - lt (Get-Date)) {}
    $oldSessions += $sess. Key
    #write "$($sess.)". User name)'
    }
    }

    # Session terminal that are inactive for more than approved ($intOlderThan)
    $sessMgr.TerminateSession ($oldSessions)

    Disconnect-VIServer *-confirm: $false

    END

    The error message I get is:

    BEGINNING

    Exception calling 'TerminateSession' with '1' or the arguments: "it was not correct to specified parameters.

    "

    D:\Scripts\vc_terminate_idle_sessions.ps1:36 char: 26

    + $sessMgr.TerminateSession < < < < ($oldSessions)

    + CategoryInfo: NotSpecified: (:)) [], MethodInvocationException)

    + FullyQualifiedErrorId: DotNetMethodException

    END

    I should mention that my knowledge of PowerCLI is almost nothing, so any help in tweaking this script to make it work with PowerCLI 5.1 Release 2 and VC 5 U2 would be much appreciated.

    The error is caused by the fact that you are trying to kill your own session (if it was started long time ago).

    Apparently in vSphere 5. they included a security mechanism integrated to avoid this.

    You can take this by adding a simple test.

    ## max number of idle minutes for sessions to keep$intOlderThan = 60$serviceInstance = Get-View 'ServiceInstance'## get the session manager object$sessMgr = Get-View $serviceInstance.Content.sessionManager## array to hold info about stale sessions$oldSessions = @()foreach ($sess in $sessMgr.SessionList){    if (($sess.LastActiveTime).addminutes($intOlderThan) -lt (Get-Date) -and          $sess.Key -ne $sessMgr.CurrentSession.Key){        $oldSessions += $sess.Key    } ## end if} ## end foreach
    
    ## if there are any old sessions, terminate them; else, just write message to the Warning streamif (($oldSessions | Measure-Object).Count -gt 0) {    ## Terminate sessions than are idle for longer than approved ($intOlderThan)    $sessMgr.TerminateSession($oldSessions)} ## end ifelse {Write-Warning "No sessions that have been idle for more than '$intOlderThan' minutes; no action taken"}
    
  • PowerCLI 5.8 Release 1 throws an exception when starting

    So I decided to upgrade my PowerCLI 5.5 R2 Patch 1 to the latest 5.8, released the last week or two. (Yes, I know, I guess I decided to live dangerously, using new versions :-)))  And the upgrade installation went well. But when I run PowerCLI, I get:

    Add-PSSnapin: the initializer for type for 'VMware.VimAutomation.Storage.Interop.V1.Service.StorageServiceFactory' threw an exception.

    C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1:48 tank: 10

    + Add-PSSnapin $snapin

    +          ~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo: NotSpecified: (:)) [Add-PSSnapin], TypeInitializationException)

    + FullyQualifiedErrorId: System.TypeInitializationException, Microsoft.PowerShell.Commands.AddPSSnapinCommand

    Someone knows why? I didn't update the vSphere CLI, just PowerCLI. I was still able to connect to my vCenter (I connect to my vCenter in my profile). But I don't know what will not work. I did a quick 'Get-VMHost', "Get - VM" and a few others - they are all working well.

    Value name

    ----                           -----

    PSVersion 4.0

    WSManStackVersion 3.0

    SerializationVersion 1.1.0.1

    CLRVersion 4.0.30319.18444

    BuildVersion 6.3.9600.16406

    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}

    PSRemotingProtocolVersion 2.2

    PowerCLI Version

    ----------------

    VMware vSphere PowerCLI 5.8 Release 1 build 2057893

    ---------------

    Versions of the snap

    ---------------

    VMWare AutoDeploy PowerCLI component 5.5 build 1983942

    VMWare ImageBuilder PowerCLI component 5.5 build 1983942

    License of VMware PowerCLI component 5.5 build 1265954

    VMware Storage PowerCLI component 5.8 build 2057894

    VMware PowerCLI VDS component 5.8 build 2031581

    VMware vSphere PowerCLI component 5.8 build 2031581

    VSphere VMware Update Manager PowerCLI 5.1 build 782803

    Ideas, anyone? Should I roll back to 5.5? Anyone else having problems?

    An update. We have improved our environment to 5.5 (all ESXi hosts and vCenter). Therefore, I improved my heavy client installation. So I decided to try again after update my Powershell to 5.8.

    And then everything just worked. No error at startup of Powershell. All respond as it should.

    Can't imagine why the 2 would be connected, but no matter, I am now under 5.8 on my Windows 7 workstation.

  • Impossible to find PowerCLI 5.5 release 1 download location

    Hi all

    I was wondering if someone can tell me PowerCLI 5.5 release 1 installation file. I need to install on Windows 2012 PowerCLI and as far as I know, this is the only version that supports Windows 2012. Unfortunately I can not find the download location for this tool, only the documentation for it. Any help would be appreciated.

    Best regards

    Hello LucD,

    Thanks for your suggestion, I tried to install PowerCLI on different station and it worked, which confirmed that I have a problem with this particular system instead of the version of it.

    I was also able to successfully install PowerCLI 5.5 on designated server (it was important for me because it is the only physical server in the environment and I need virtual shutdown in case of power failure).

    The solution was easy, so I thought: I had to install all the updates from Windows Update since December of 2013 (that was the last time updates have been installed), after that (and the restart of the ofc) PowerCLI 5.5 installation went very well.

    Thanks for your help and your time - I really appreciate your efforts.

    Best regards

    Gro'rhor

  • Handling of keys with powerCLI

    I need to add and remove keys vCetner with powerCLI.  My hope was to add new keys to a txt or csv type file and run a small powerCLI script to remove old keys and add the new keys in the file.  I'm sure I can find a way extract the file, but I do not know what commands PowerCLI to use to control the vCenter.

    Does anyone know how to do this?

    Or at least point me in the right direction (perhaps with a few power CLI commands, I can't find any dealing with adding or deleting key.)?

    Have you already checked my post to license of vCenter ?

    Currently, there are no cmdlets for managing licenses, but it's pretty easy to call the PowerCLI SDK API.

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • How to fix "your trial period has expired. License with an account online or a product key.

    Hello

    I use a licensed version of Visual Studio 2015. All of a sudden, it stopped working and ended up with the following error when I try to run VS2015.

    "Your trial period has expired. License with an account online or a product key.

    I tried to unlock it with my Microsoft account, but it doesn't.

    Please, help me to extend my license or trial period.

    Hello

    Your question is beyond the scope of this community.

    Please post your question to the MSDN Visual Studio Forums.

    https://social.msdn.Microsoft.com/forums/vstudio/en-us/home?category=VisualStudio

    TechNet forums:

    https://social.technet.Microsoft.com/forums/en-us/home

    MSDN forums:

    https://social.msdn.Microsoft.com/forums/en-us/home

    See you soon.

  • AnyConnect 4.0 license with ASA-5515-FPWR

    Hi all

    I have a small question, where I can't find a clear answer for:

    A customer wants to buy a new ASA for a showroom. He wants to connect 30 phones VPN and 60 VPN users, where only 10 of them are simultaneously connected. Then we would have two choices now

    -Either go with the 3.5 Anyconnect licensing, with a premium SSL 50 license and activation phones VPN and mobility AC licenses

    - Or go to AC 4.0 license, where we would have to license 100 users with MORE licenses.

    My questions are:

    -Can I any other / more license on the SAA (i.e. SSL)

    -Where to install the license

    -How is the number of users (i.e. of the ad groups, local accounts)

    Is there a documentation clearly indicating the answers

    Thank you all for your help.

    If you want that the phone itself to be the endpoint remote VPN access, then Yes - you need VPN phone license which requires in turn AnyConnect Premium (for 3.x installations)

    "Plus" AnyConnect (for 4.x) includes 'VPN functionality for PC and mobile platforms, including per-app VPN on mobile platforms and phone Cisco VPN' (referring to the January 2015 of the ordering Guide AnyConnect 4.0 version)

  • Can we can implement App - V license with the SMB file streaming

    Hello

    We are currently in place a complete infrastructure of App-V 4.6 SP2 in our Organization, and we have all applications stored in a SMB file server. We have two App - V Management servers related to a balancerto load. In addition, we have configured the ApplicationSourceRoot registry key in the machines of Client pointing to the SMB file server. The flow of applications successfully from the SMB file server. So far everything was fine.

    However, when we try to implement the licensing options we see that App - V licenses work with RTSP protocols. In addition, we tried all the best we can, but we could not implement RTSP streaming from a SMB file server.  Protocol of RTSP protocol leader changes: / / with the use of the ApplicationSourceRoot registry key.

    Can anyone suggest a work around for this problem, where we can implement App - V license with the spreading of the SMB file?

    Thank you

    Arun

    Arun

    Server issues should be placed here

  • Hello, my computer down and I bought another. How can I install Adobe Acrobat XI pro on the new computer with my license? In fact, it's already used with my old computer which is broken...?

    Hello, my computer down and I bought another. How can I install Adobe Acrobat XI pro on the new computer with my license? In fact, it's already used with my old computer which is broken...? !

    you are allowed to two facilities/activations.  If you want / need to restore those, contact adobe support and application and activation count reset.

    Use a browser that allows cookies and pop-up windows, please contact adobe for hourly pst support by clicking here and, when it is available, click "still need help," https://helpx.adobe.com/contact.html

    Available downloadable Setup files:

    Download and installation help links Adobe

    Help download and installation to Prodesigntools links can be found on the most linked pages.  They are essential; especially steps 1, 2 and 3.  If you click on a link that does not have these listed steps, open a second window by using the link to Lightroom 3 to see these "important Instructions".

  • How can I get the version of VMware to virtual machines with powercli officer?

    How can I get the version of VMware View Agent running on a virtual machine with powercli or view Powercli?

    As much as I know there is no cmdlet PowerCLI for this, but you can use the Invoke-VMScript cmdlet and interrogate the Win32_Product class.

    By running the following. You can add a Where clause to return only the Agent of the view

    Get-WmiObject-class Win32_Product | Select the name, Version

  • count the number of targets, devices and paths by hba for each host with powercli 5.5

    Hi all

    I'm writing this Question again in the community, was not able to found the answer I was looking for in the nets:

    https://communities.VMware.com/thread/516226?start=0 & tstart = 0

    https://communities.VMware.com/thread/293531

    I went through the scripts provided in the community, but seems that t not work on powercli 5.5.

    ///

    # The target account, devices and paths for each host

    Get-Cluster $cluster | Get-VMHost | Sort-Object-property name. {ForEach-Object

    $VMHost = $_

    $VMHost | Get-VMHostHba-type FibreChannel | Sort-Object-property device | {ForEach-Object

    $VMHostHba = $_

    $ScsiLun = $VMHostHba | Get-ScsiLun

    If {($ScsiLun)

    $ScsiLunPath = $ScsiLun | Get-ScsiLunPath | `

    Where-Object {$_.} Name - like "$($VMHostHba.Device) *"} ".

    $Targets = ($ScsiLunPath |) »

    Group-object - property SanID | Measure - Object). County

    $Devices = ($ScsiLun |) Measure - Object). County

    $Paths = ($ScsiLunPath |) Measure - Object). County

    }

    Else {}

    $Targets = 0

    $Devices = 0

    $Paths = 0

    }

    $Report = "" | Select-Object - property VMHost, HBA, target devices, paths

    $Report.VMHost = $VMHost.Name

    $Report.HBA = $VMHostHba.Device

    $Report.Targets = $Targets

    $Report.Devices = $Devices

    $Report.Paths = $Paths

    $Report

    }

    }

    ///

    I went through the script LucD posted below: but it's not exactly what I'm looking for.

    LucD : can you please change the same for me please.   to count the number of paths per hba for each host with powercli 5.5, devices and targets.

    //

    $esx = get-VMHost < host name >

    foreach ($hba to (VMHostHba Get - VMHost $esx - type "FibreChannel")) {}

    $target = ((get - see $hba. VMhost). Config.StorageDevice.ScsiTopology.Adapter | where {$_.} Adapter - eq $hba. Key}). Goal

    $luns = get-ScsiLun - Hba $hba - LunType 'disk '.

    $nrPaths = ($target | % {$_.}) Lun.Count} | Measure - Object - sum). Sum

    Write-Host $hba. Device ' target: ' $target. County "devices:" $luns. County ' path: ' $nrPaths

    }

    //

    I'll be grateful for any help.

    Tarun Gupta

    Try something like this

    {foreach ($esx in Get-VMHost)

    foreach ($hba to (VMHostHba Get - VMHost $esx - type "FibreChannel")) {}

    $target = ((get - see $hba. VMhost). Config.StorageDevice.ScsiTopology.Adapter | where {$_.} Adapter - eq $hba. Key}). Goal

    $luns = get-ScsiLun - Hba $hba - LunType "disk" - ErrorAction SilentlyContinue

    $nrPaths = ($target | % {$_.}) Lun.Count} | Measure - Object - sum). Sum

    $props [ordered] = @ {}

    VMHost = $esx.name

    HBA = $hba. Name

    Target = $target. County

    Device = $luns. County

    Path = $nrPaths

    }

    New-object PSObject-property $props

    }

    }

  • Hello friends, I have a license with terms of the photo with Photoshop and Lightroom applications installed on my iMac. Question: With this license can I install these applications also in my notebook? Using the same license.

    Hello friends, I have a license with terms of the photo with Photoshop and Lightroom applications installed on my iMac. Question: With this license can I install these applications also in my notebook? Using the same license.

    Yes, individual licenses, ranging up to allow two simultaneous, activations facilities.

    subscriptions allow mounting on an unlimited number of computers.  connection is limited to a maximum of two computers at a time.

  • Unable to connect to vCD with PowerCLI

    Hi, can you help me with troubleshooting problem with connecting in vCD using PowerCLI.

    When I log in using my system administrator account

    Connect-CIServer vcdCell01 - User "username-password"pass"

    I get:

    Connect-CIServer: 11/30/2015 connect 12:19:21 AM-CIServer the

    Server returned "Unauthorized" with the status of the authorized 401 - no code.

    On line: 1 char: 1

    + Connect CIServer vcdCell01 - User "username-password 'pass' '.

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo: NotSpecified: (:)) [connect-CIServer], CIException)

    + FullyQualifiedErrorId: Cloud_ConnectivityServiceImpl_ConnectCloudServer

    _ConnectError, VMware.VimAutomation.Cloud.Commands.cmdlets.ConnectCIServer

    I can connect to the Web user interface using the same system administrator account.

    The only way I can connect with PowerCLI is when I create the local account in one of the organizations and Add - Org to order

    Connect-CIServer vcdCell01-user "localuser" - password 'localpass' - 'org' Org

    Help, please.

    I used a few tricks of Python to connect to vCD. To connect as a system administrator, I had to use "Administrator@System" as the user.

    Maybe it will work for you if you use '-Org system?

  • $global: variable defaultVIServer gets replaced by data warehouses in PowerCLI 6.0 Release 2

    I recently noticed a strange behavior with the variables global:defaultVIServer(s) of $.

    The content has been change in the middle of my script. especially after sub $global: defaultVIServer.Name

    10.10.10.10 for 10.10.10.10@443

    For some reason any port number was getting stuck at the end of the name field, which failed in the cmdlet Test-connection (ping).

    After some research, I went down to my use of the global variable of VMware, vmstores

    The following line replaces $global: defaultVIServer

    $dsList = (dir-path vmstores :)

    Code snippet

    to connect-VIServer $vctIP

    Global $: defaultVIServer | FL

    $dsList = (dir-path vmstores :)

    Global $: defaultVIServer | FL

    $dsList | FL


    You can see that $global: defaultVIServer gets replaced by the data of $dsList after the dir command

    Screenshots are attached.


    At least, I have to unplug my server and reconnect to solve this problem.


    Is there a better way to get the list of warehouses of data (and their paths) with PowerCLI 6.0?

    Maureen

    I only call this command in one place in my scripts, so I tested for a '@' char in the $global: variable DefaultViServer after this call and if I find it then I disconnect and reconnect to my servers.  This version fixes the global variable, which I use in other places in my scripts.

    I didn't change my scripts having to use the other variable, $global: DefaultVIServer.ServiceUri.Host,.

    because it would have been a little more difficult.

    In addition, when the bug fix is implemented, I won't change my scripts.

    Extracted from:

    foreach ($server in $global: DefaultViServers)

    {

    # check if @ tank is in the name; i.e. @port_number

    If ($server. Name - match ' @')

    {

    # split the name IP address and port number

    $serverNameList = $server. Name.Split('@')

    Disconnect $serverNameList VIServer [0]

    sleep - 1 seconds

    SE $serverNameList connect-VIServer [0]

    }

    }

Maybe you are looking for