Use of VMWare.Vim.dll without PowerCLI

Hello

Is it possible to use VMWare.Vim.dll without installed PowerCLI?

I developed a code using VMWare.Vim.dll in my system that has installed PowerCLI.

When I run the application in another machine, it is thrown exceptions.

Is required PowerCLI in the machine in which we execute the application?

Thank you.

According using VMware vSphere PowerCLI views from .NET it seems to require installation of PowerCLI.

Tags: VMware

Similar Questions

  • Clarification of the VMware.Vim.VirtualMachineRelocateSpec

    I'm trying to run a script to create scheduled jobs to move virtual machines to a data to another store.

    I use the VMware.Vim.VirtualMachineRelocateSpec object to specify where each virtual machine must be reinstalled.

    I want to change only the deatastore, not the host, but everything by creating regular taste, I can't specify 'Change datastore' because 'Change of host and data store' is selected in any case.

    It is a problem if the virtual machine is running...

    Can someone please help?

    Concerning

    Marius

    According to the documentation of the official API @ VMware.Vim.VirtualMachineRelocateSpec.

    We can just specify target datastore, where any vSphere SDK + PowerCLI must also honour.

    Can you please post your script here?

  • VMware.vim.datastore Summary.FreeSpace reports wrong values

    Hello

    I use the vmware.vim.datastore Summary.FreeSpace, same newly retrieve the object, it reports the wrong values. I did other tests with vSphere CLI Power, which signals the right values. If possible, I want to use Web services to retrieve data. Is this a bug? Is it possible to get the right values with the SDK.  I think that it should be possible to get good values, because the CLI of power can also recover it somehow.

    I also have a problem of computing the values of Gigabyte. I used to divide by 1024 values until I'm GB but my values are different from the values displayed in the vSphere Client.

    Concerning

    Manfred

    Hey Manfred,

    We have not seen the incorrect values for the property datastore.summary.freespace using the SDK. You can probably try to refresh the data store, as mentioned by William Lam in the post above, and check if it stills shows incorrect values. PowerCli under uses API to extract the values of the properties of Web services. Therefore, you should see the same result/values when using the SDK and PowerCLI. You can also overlaps with the value displayed in the CROWD, http:///moband forest such freespace property down to the required property. Is you still face the question, you can share the code whereby you try to recover the property as well as the screesnhot to the VI Client for the same property.

    I hope this helps.

  • Using GPMC dll without installing GPMC product

    Hi friends,

    I'm developing a c# application that compares the GPO of the current computer with the recommended. It should be a 'light' app that can run on multiple computers without installation.

    In order to read the GPO to the computer, I used "Microsoft.GroupPolicy.Management.dll" (it works well).

    I copied the exe and the dll (including the error message) in a folder to another computer, when I run it, I get the following error:

    Could not load file or assembly 'Microsoft.GroupPolicy.ServerAdminTools.GpmgmtLib, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' or one of its dependencies. The system cannot find the specified file.

    Is it possible to use the GPMC dll without the product of the GPMC installed?

    Eyal.

    Reginiano,

    As you try to develop an application of C3, this query is best in the following MSDN forum.

    Thanks for posting the request here.

    Answer if you have other issues with Windows and we will be happy to help.

  • VMware Capacity Planning without using an Internet connection

    Hello

    I tried run VMWare Capacity Planner without using an Internet connection. I have run Performance and utility collection of inventory and then I synced data. I was able to see the CSV files in the Outbox. I copied the folder on an interenet connection machine having when I click on synchronize data, it began to send the data to the dashboard. the data has been sent successfully, but when I am logged into the dashboard there is no data view. A message was displayed as not enough data.

    Please let me know if I made a mistake in my approach.

    Thank you

    Pravesh

    can u check with the administrator of your organization, which has admin on dash rights and see if the data is correctly downloaded to the dashboard.

    also can ensure you that you use the same credentials on the two boxes on the client side. simple reason being it might be issue with the property user and group data that are downloaded.

  • Update boot entry automatic using vmware-vim-cmd (or vmware-vimsh)

    Hello

    Is there an example of how update the automatic start-up using vmware-vim-cmd input.

    The problem that I am running is

    1. when I type

    VMware-vim-cmd hostsvc/autostartmanager/update_autostartentry 16 powerOn-1 1-1 systemDefault systemDefault

    When 16 is one of my VMIds, I get the following

    Invalid option '1'

    Use: update_autostartentry VMId StartAction StartDelay StopAction StopDelay WaitForHeartbeat Strafpkt

    I can't understand what the invalid option '1'.

    Here's what I've done so now

    1. research in the communities for examples. There are a few messages, but none seem to provide real-world examples of work (beyond the use of message)

    2. I found this link http://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.host.AutoStartManager.AutoPowerInfo.html who talks about what type of entry it is pregnant. I tried double quoting and only citing the parameters of xsd: String, but that did not work either

    3. I tried the particular settings (including the xsd: int) doublequoting, which did not work either

    Anyone successful with this? If so could you please post a real example.

    Here's what I'm trying to accomplish

    1 activate Autostart - I did that using

    / usr/bin/VMware-vim-cmd hostsvc/autostartmanager/enableautostart true

    2. get all VMIds in the system

    I did it with the following command and awk script

    / * Awk script * /.

    BEGIN {}

    FS = ""

    NR 1 >

    }

    {

    If (NR == 1) {}

    #ignore header

    }

    else {}

    1. $1 has VMIds

    Print $1

    }

    }

    / * End awk script * /.

    Then run/bin/awk f /root/autostart.awk

    3. instead of printing on $1, I would like to add the virtual machines to the list using the following

    a. start-up delay = systemdefault

    start-up (b) action = poweron

    c. start order = 1, 2, 3, 4 (do not need help with AWK script), I can post once I have that.

    d. stopaction, stopdelay etc. - leave at the default system (or - 1 as the pubs suggested link)

    I'm sure that there are more effective and these ways to do this, I need to follow this approach for a specific reason.  I was wondering if someone can help me with the syntax correct for vmware-vim-cmd hostsvc/autostartmanager/enable_autostart please?

    Thanks for your help!

    -Vermorel

    It seems that the problem is with you using -1 as input for StartDelay and StopDelay,-1 is not a valid entry that I tested, and you must specify either systemDefault or a time interval.

    I created 4 VMS dummy on ESXi 4.0 host and did the following and it worked:

    Enable auto-start through vimsh (vim - cmd)

    ~ #  vim-cmd hostsvc/autostartmanager/enable_autostart 1
    Enabled AutoStart
    

    Adjustment of the 1st virtual machine:

    ~ # vim-cmd hostsvc/autostartmanager/update_autostartentry 1264 "PowerOn" "15" "1" "systemDefault" "systemDefault" "systemDefault"
    
    1Updated AutoStart order.
    

    Definition of the 2nd VM:

    ~ # vim-cmd hostsvc/autostartmanager/update_autostartentry 1232 "PowerOn" "15" "2" "systemDefault" "systemDefault" "systemDefault"
    
    2Updated AutoStart order.
    

    Definition of the 3rd VM:

    ~ # vim-cmd hostsvc/autostartmanager/update_autostartentry 1280 "PowerOn" "15" "3" "systemDefault" "systemDefault" "systemDefault"
    
    3Updated AutoStart order.
    

    Definition of the 4th VM:

    ~ # vim-cmd hostsvc/autostartmanager/update_autostartentry 1264 "PowerOn" "15" "4" "systemDefault" "systemDefault" "systemDefault"
    
    4Updated AutoStart order.
    

    You can manually set the automatic start/stop by using the vSphere Client and using the following command to retrieve the config:

    vim-cmd hostsvc/autostartmanager/get_autostartseq
    

    which can then be used as a basis to set the configuration.

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    Twitter: @lamw

    repository scripts vGhetto

    Introduction to the vMA (tips/tricks)

    Getting started with vSphere SDK for Perl

    VMware Code Central - Scripts/code samples for developers and administrators

    150 VMware developer

    If you find this information useful, please give points to "correct" or "useful".

  • Rename a "Service Console" portgroup using vmware-vim-cmd

    Hey all

    Just going through the forums concerning the "vim-vmware-cmd" command and was wondering if there was a way we could rename the portgroup console Service. Have a script that I prepare and one of its stages is to rename its SC which I don't really know how to do it using 'vim-Vmware-cmd ".

    Any help would be great?

    Munster

    (PS - thanks in advance)

    As far as I know, there is no way to rename a portgroup. With vswif/esxcfg-vswitch or with vmware-vim-cmd. However the deletion and add it with the new name should do the trick for you.

    The option addvmportgroup in kickstart can be 0 or 1. He tells the configuration to add a GRPE on default ports for virtual machines, called "VM Network" on the first vSwitch or not. It has nothing to do with the designation of portgroup Console of service.

  • Impossible object type cast 'VMware.Vim.ClusterVmHostRuleInf o' type 'VMware.Vim.ClusterAntiAffinityRuleSpec '.

    Hello

    I was surprised by this error. Any who see it this way? I was doing some affinity for the cluster rules. At the beginning when there was no vmgroups, hostgroups, no virtual machine to the rules of the host, this command worked very well, that no errors were generated. According to the rules of antiaffinity of vm-virtual machine, I did a few groups of MV, the host groups and created AA rules for this cluster as well via the api.  Everything has not worked well, no errors when creating. But after a few days, I wanted to add 1 more AA machine vm-virtual rule. And I received this error, no idea why this would come to the top? This error appears, but the rule is created anyway.

    PowerCLI C:\ > XYZ New-DrsRule-Cluster - name AA-vm1-vm2 - KeepTogether: $false VM - vm1, vm2
    New-DrsRule: 14/05/2012 09:30:23 impossible object type cast New-DrsRule ' VMware.Vim.ClusterVmHostRuleInf
    o ' to type 'VMware.Vim.ClusterAntiAffinityRuleSpec '.
    Online: 1 character: 12
    + New-DrsRule < < < < - XYZ - name AA-vm1-vm2 Cluster - KeepTogether: $false VM - vm1, vm2
    + CategoryInfo: NotSpecified: (:)) [new DrsRule], ViError)
    + FullyQualifiedErrorId: Client20_ClientSideTaskImpl_ThreadProc_UnhandledException, VMware.VimAutomation.ViCore.Cm
    dlets.Commands.NewDrsRule

    Thank you

    Greg

    BTW.

    Why he would mount "VMware.Vim.ClusterVmHostRuleInfo"?

    "An object of ClusterVmHostRuleInfo identifies virtual machines and the host groups that determine the position of the virtual machine. Virtual machines and the host referenced by a rule of VM-host must be in the same cluster. »

    But it is a rule antiaffinity VM - VM, not a vm host rule.  I still have no idea why the error comes out but I used onyx to see if I have the same problem when you do it with the api:

    $spec = new-Object VMware.Vim.ClusterConfigSpecEx
    $spec.rulesSpec = new-Object VMware.Vim.ClusterRuleSpec [] (2)
    $spec.rulesSpec [0] = new-Object VMware.Vim.ClusterRuleSpec
    $spec.rulesSpec [0] .operation = 'Add '.
    $spec.rulesSpec [0] = new-Object VMware.Vim.ClusterAffinityRuleSpec .info
    $spec.rulesSpec [0].info.enabled = $true
    $spec.rulesSpec [0].info.name = "AA-vm1-vm2.
    $spec.rulesSpec [0].info.userCreated = $true
    $spec.rulesSpec [0].info.vm = new-Object VMware.Vim.ManagedObjectReference [] (2)
    $spec.rulesSpec [0].info.vm [0] = new-Object VMware.Vim.ManagedObjectReference
    $spec.rulesSpec [0].info.vm [0] = 'VirtualMachine' game
    $spec.rulesSpec [0].info.vm [0] .value = "vm-xxxxxxx".
    $spec.rulesSpec [0].info.vm [1] = new-Object VMware.Vim.ManagedObjectReference
    $spec.rulesSpec [0].info.vm [1] = 'VirtualMachine' game
    $spec.rulesSpec [0].info.vm [1] .value = "vm-yyyyyyy.

    _this $ = get-view-Id "ClusterComputeResource-domain-c345645464.
    _this $. ReconfigureComputeResource_Task ($spec, $true)

    It works without errors

    Hi Greg,.

    Thank you for reporting this issue. I can also confirm that it is a bug that is caused by vm-to-host rules. We already fixed for the next version.

    Kind regards

    Yasen

  • VMware-vim-cmd check vmwaretools available

    Hello!

    I want to make a script (with bash) to stop my VMs.

    with vmware-vim-cmd vmsvc/power.shutdown ID, I can stop my VM.

    But if vmware-Tools are noticed running I want to turn off the coast of the VM hard.

    How can I check if vmware-tools are available and how can disable VM without vmware-tools?

    THX.

    Hansi

    The vim - cmd, you can use the vmsvc/get.guest allows to check if the tools are running:

    # vim - cmd vmsvc/get.guest 28 | grep toolsRunningStatus
    toolsRunningStatus = "guestToolsRunning"
    # vim - cmd vmsvc/get.guest 18 | grep toolsRunningStatus
    toolsRunningStatus = "guestToolsNotRunning".

    You can also include a vim - cmd vmsvc/power.getstate in your script to see if the VM is actually powered-on, since the status of tools will be guestToolsNotRunning on a virtual computer off of course.

    Hard power off mV, use vmsvc/power.off.

  • Remoisturizing entirely a Vim.dll Vimclient

    Not for Powershell, but the undelrying Vim.dll.

    I want to use it in a web about and rather than dealing with nightmares of file management I want to scratch the vmware_soap_session cookie, serialize the value for her and restore the session from the cookie on the recall instead of reconsignation in etc.

    Well, I have the cookie and the reconnection done, but after you restore the Cookie, I still have a null ServiceContent.  The LoadSession doesn't have this problem, so I guess I can do something for the shot of the VimClient so he re-established the underlying connection. It looks like if I call a GetView to a known entity that can help, but it seems rather brutal.  Is there a more elegant way to re-establish the connection after you restore the cookie?

    Also, I want to remove the need for a VimClient method to determine whether a session is under tension after the restoration.  I used just to call on ServiceInstance CurrentTime in the WebServices and capture the exception.  The 'isSessionActive' in SessionManager requires the user name and rather than having to carry around tooit would be easier to have a bool who used currentSession data in the cookie.  In all cases before kicking the SessionManager VimClient is null if this is a no go anyway.

    J

    Hello

    If you do not want to backup/restore the cookie session to/from file, you can directly add VMware session cookie to VimClient.WebService.CookieContainer (in fact, LoadSession do the same thing):

    
    Cookie sessionCookie = ....; // Already get vmware_soap_session cookie
    
    VimClient vimClient;
    vimClient = new VimClient();
    vimClient.Connect(serviceUrl);
    vimClient.VimService.CookieContainer.Add(sessionSookie);
    SessionManager sessionMngr =
           new SessionManager(vimClient, vimClient.ServiceContent.SessionManager);
    sessionMngr.UpdateViewData();
    
    if (sessionMngr.CurrentSession == null) {
       throw new InvalidOperationException("Fail to reuse session cookie");
    }
    

    Kind regards

    Yasen

  • I can't run my dll without having Intel Fortran composer in the computer

    I have compiled a dll by using Microsoft Visual Studio and Intel Fortran composer. In my computer, they work fine, but when I try to run it on another computer that does not have MVS and the compiler I get this message:

    Application error

    The application was unable to start correctly (0xc000007b). Click OK to close the application.

    Is it possible to execute these DLLs without any MVS and the compiler in the computer?

    Felipe Lopez

    The most recent Intel libraries have a folder called "redist" for redistrubutable. For PVE, the library is "C:\\Program Files (x 86) \Intel\ComposerXE-2011\redist). My view is that they did this to avoid any confusion on what has been authorized to redistribute.

    Good luck

  • VMware.Vim.ClusterVMGroup returned by ExtensionData.Configurationex.Group instead of groupnames

    When I run a query of powershell to find groupnames in ExtensionData.Configurationex.Group I see the groupnames expected.

    PowerCLI C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts > Get-cluster | Select Name,@{Name="Group; Expression = {$_.} Ex

    tensionData.Configurationex.Group}} |? {$_. {Name - like "lax-devtest *"}

    Name                                                              Group

    ----                                                              -----

    Lax-devtest4 {winsvr-vm, mssql-mssql-vm, host-winsvr}

    Lax-devtest1

    Lax-devtest3 VMware.Vim.ClusterVmGroup


    However if I change the type of output (html, csv, etc.). I don't see the gorupnames.


    PowerCLI C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts > Get-cluster | Select Name,@{Name="Group; Expression = {$_.} Ex

    tensionData.Configurationex.Group}} |? {$_. {Name - like "lax-devtest *"} | Export-csv c:\tmp\getcluster.csv

    #TYPE Selected.VMware.VimAutomation.ViCore.Impl.V1.Inventory.ClusterImpl

    Name

    Group

    Lax-devtest4

    VMware.Vim.ClusterVmGroup VMware.Vim.ClusterVmGroup VMware.Vim.ClusterHostGroup VMware.Vim.ClusterHostGroup

    Lax-devtest1

    Lax-devtest3

    VMware.Vim.ClusterVmGroup

    Why other types of outputs return VMware.Vim.ClusterVmGroup instead of names?  This also affects research because only VMware.Vim.ClusterVmGroup is visible when looking for names of.


    My bad, you must of course extract the name, otherwise you will get the name of the object behind the property.

    Try like this

    Get-cluster | Select Name,@{Name="Group";Expression={[string]::Join(',',($_.ExtensionData.Configurationex.Group | Select -ExpandProperty Name))}}
    
  • VMWare VIX instant without memory

    I use the VMware VIX utility to automate the snapshot of a virtual server on my vCenter.  When I manually take the snapshot of the VMWare Infrastructure GUI, I uncheck the option to include the memory of the virtual machine, and my snapshot takes a minute or two.  When I take a snapshot using the following command, it takes nearly 19 minutes.

    C:\Program VMware VIX > vmrun t h CR https://10.0.0.186/SDK oshq\achenard u Pei * snapshot "[OSCVMESX-flight6] OSCVMD .
    B01/OSCVMDB01.vmx' mySnapshot

    My first thoughts were that it was including the memory of the virtual machine in the snapshot and I tested it using the GUI and leaving the check for the memory of the virtual machine and which took 19 minutes as well.  There is an argument that I can include to turn off the option to take a snapshot of the virtual machine?  Or y at - it another way I can run a snapshot from a remote machine that PowerShell?

    You must use Visual Studio 2008 to compile the module Perl de VIX.

    On Windows, if you do not have Visual Studio, for easy to use, I would recommend using VBScript. COM of VIX library version is installed and registered, so it can be used without any other step.

    Dim lib

    Sun host

    Dim job

    Sun vm

    Dim results

    Instant Sun

    Set lib = CreateObject ("VixCOM.VixLib")

    Set job = lib.Connect(VixCOM.Constants.VIX_API_VERSION, VixCOM.Constants. VIX_SERVICEPROVIDER_VMWARE_VI_SERVER, "https://10.0.0.186/sdk", 0, "oshq\achenard", "******", 0, Nothing, Nothing)
    

    "the results must be initialized before it is used, even if it'll just be crushed.

    Set results = nothing

    ERR = job. Wait (Array (VixCOM.constants.VIX_PROPERTY_JOB_RESULT_HANDLE), results)

    If lib. ErrorIndicatesFailure (err) then

    'Handle the error... ".

    End If

    Set host = results (0)

    Permanent job = host. OpenVM ("[OSCVMESX-flight6] OSCVMDB01/OSCVMDB01.vmx", null)

    ERR = job. Wait (Array (VixCOM.constants.VIX_PROPERTY_JOB_RESULT_HANDLE), results)

    If lib. ErrorIndicatesFailure (err) then

    'Handle the error... ".

    End If

    The value of vm = results (0)

    Permanent job = vm. CreateSnapshot ("mySnapshot", "", 0, NULL, null)

    ERR = job. Wait (Array (VixCOM.constants.VIX_PROPERTY_JOB_RESULT_HANDLE), results)

    If lib. ErrorIndicatesFailure (err) then

    'Handle the error... ".

    End If

    Snapshot = results (0)

    ' Use snapshot...

    The snapshot value = Nothing

    Set results = nothing

    Job Set = Nothing

    The value of vm = Nothing

    host. Disconnect()

  • VMware.Vim.DVSSecurityPolicy

    After reading some articles on the site of Luke (www.lucd.info)

    I used some of its functions to create some dswitches.

    The trade creation, I wanted to change the security settings to prohibit, promiscious mode, changes in mac and forged passes, as follows:

    $spec.defaultPortConfig.securityPolicy = new-Object VMware.Vim.DVSSecurityPolicy

    $spec.defaultPortConfig.securityPolicy.allowPromiscuous = $false

    $spec.defaultPortConfig.securityPolicy.forgedTransmits = $false

    $spec.defaultPortConfig.securityPolicy.macChanges = $false

    But for some reason any, that this does not work, I get the following error:

    Exception definition "MacChanges": "cannot convert value"False"by"type VMware.V"

    IM BoolPolicy '. Error: "Invalid typecast"System.String"' VMware.Vim.BoolP".

    are "." »

    What I am doing wrong?

    Try this:

    $spec.defaultPortConfig.securityPolicy.macChanges = New-Object VMware.Vim.BoolPolicy
    $spec.defaultPortConfig.securityPolicy.macChanges.Value= $false
    

    The same approach applies to the allowPromiscuous and forgedTransmits properties.

    Kind regards

    Yasen

  • How to create table of type vmware.vim.OptionValue]

    $o = New-Object vmware.vim.OptionValue
    
    PS H:\> $o = New-Object vmware.vim.OptionValue[]
    New-Object : Constructor not found. Cannot find an appropriate constructor for
    type vmware.vim.OptionValue[].
    At line:1 char:16
    + $o = New-Object  <<<< vmware.vim.OptionValue[]
    

    This constructor is missing

    I use a loop.

    $t = @()
    for($i=0; $i -lt 10;$i++){
         $t += New-Object VMware.Vim.OptionValue
    }
    

Maybe you are looking for

  • "' I'm a toolbar with ' writing ', address book, etc.

    When Thunderbird opens, it is in the Inbox, no way to wite meaassges or get address book.

  • A problem after changing my apple id email

    Hello and have a nice day everyone 1 first I want to mention that English is not my first language but I hope that I can make my problem clear I was using the same identifier apple for my Iphone and my Ipad, but my brother wanted the Apple ID for him

  • I want to open my download with

    When I download a file, (try to download net framework) it goes into my downloads.  When I go to my downloads to open I get a box asking me what I want to open it with.  I never got that before on my other computers.  Download just opened.  Don't kno

  • Forgotten password to log on to the computer and have not set a hint.

    This is for windows XP son put password on the machine and don't remember the password that he did not set a hint. I have no idea where to start to log in and access the machine. Remember - this is a public forum so never post private information suc

  • Double-click issue when it should only click 1 time

    I'm having a problem when I click my mouse 1 time, he thinks that I double clicked it.  It must be the new computer with Windows 8 as my old computer has never had a problem.  I use the computer to place their orders online for a particular company a