to connect-viserver to several viservers @ simultaneously fails

Hello

because they are forced to leave related modes, we cannot use the connect-viserver - alllinked more...

If google told me to use connect-viserver vc1, vc2

You can check this, if you check the $global value: DefaulViServers

In my case, there is only the vc2 listed, even if the connection to the two vcenters works very well...

Version is 5.1 Release 1 PowerCLI

Why?

THX in advance

Chakoe

Add the parameter Scope

Game-PowerCLIConfiguration - multiple DefaultVIServerMode - Scope Session

Tags: VMware

Similar Questions

  • How to operate with several connections open for VCs (Connect-VIServer).

    Hello:

    I know that I can open multiple connections to VCs (Connect-VIServer), but do not really understand how to run with them...

    How can I speak in VC1 for a single operation and after that VC2 to another without closing the connection in VC1?  I might need to do this several times in my script...

    Any help and simple example will be really appreciated.

    Thank you

    qwert

    The cmdlet Connect-VIServer of PowerCLU 4u1 leave takes supported several open sessions.

    The sessions are stored in a table called $defaultVIServers.

    If you need restore an open session, you can use the entry for this server in the array and then use the SessionId property to make this session open session / by default (which is stored in the variable $defaultVIServer).

    Something like that

    Connect-VIServer -Server VC1
    Connect-VIServer -Server VC2
    # Show the sessions and their properties
    $defaultVIServers | Select *
    
    # Open the session to VC1
    Connect-VIServer -Session $defaultVIServers[0].SessionId
    
    # Open the session to VC2
    Connect-VIServer -Session $defaultVIServers[1].SessionId
    
    # The open session
    $defaultVIServer
    
  • connection of several VC with connect-viserver

    Based on another post, I tried to connect to multiple environments within a script.   My intention was to use

    $vclist = 'server1', 'Server2', 'server' 3

    {foreach ($vc to $vclist)

    to connect-viserver $vc

    }

    So to do the job

    {foreach ($connection in $defaultVIServers)

    to connect-viserver-session $connection. SessionId

    {do work}

    }

    It did not work. A command such as get - vm were withdrawing from all 3 of VC.   Should I rewrite with a connect then disconnect?

    How to work with different connections is implemented a little differently.

    First of all, make sure that you configure PowerCLI to work in multi mode.

    $config = Get-PowerCLIConfiguration if($config.DefaultVIServerMode -eq "Single"){
        Set-PowerCLIConfiguration -DefaultVIServerMode Multiple}
    

    Open your vCenter or ESX (i) connections

    $vclist = "server1","server2","server3" foreach ($vc in $vclist){
         connect-viserver $vc}
    

    When you run a cmdlet against a use specific vCenter the -Server setting

    Get-VM -Server $defaultVIServers[0]
    

    If you omit the - server parameter and you run in multi mode, the cmdlet will run against all connections.

    The $defaultVIServers variable contains all the connections.

  • start-work using connect-viserver hangs in powercli 6

    Hello

    Previously, I used powercli jobs to execute commands to invoke vmscript quite successfully in our workplaces 5.1 and 5.1.

    I'm testing these scripts in vSphere 6 with pwoercli 6 and am having some problems with the script.

    An example of the previous scripts that worked is as follows:

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

    Start-job-name $vm - RunAs32 - PSVersion 2.0 - scriptblock {}

    Param ($vm, $vcentre, $GuestCred, $session)

    {if(!$Global:DefaultVIServer)})

    If (!) () Get-pssnapin. where {$_.name - eq "vmware.vimautomation.core"})) {}

    try {}

    Add-pssnapin VMware.VimAutomation.Core - ea 0. out-null

    } catch {}

    throw "could not load the PowerCLI snap."

    }

    }

    try {}

    to connect-viserver $vcentre - $session wa - 0 session | out-null

    } catch {}

    throw "Failed to connect to server VI".

    }

    }

    $TestGuestCredentials = "dir C:\. »

    Invoke-VMScript - VM $vm GuestCredential - $GuestCred - $TestGuestCredentials ScriptText

    } - ArgumentList, $vm, $GuestCred, $session, $vcentre | FT

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

    Now, in powercli 6 using modules that I tried to edit the script as well as the previous option using addsnapin is no longer works:

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

    Start-job-name $vm - RunAs32 - PSVersion 4.0 - scriptblock {}

    Param ($vm, $vcentre, $GuestCred, $session)

    If (!) () Get-Module-name VMware.VimAutomation.Core - ErrorAction SilentlyContinue)) {}

    . "C:\Program Files (x 86) \VMware\Infrastructure\vSphere.

    }

    try {}

    to connect-viserver $vcentre - $session wa - 0 session | out-null

    } catch {}

    throw "Failed to connect to server VI".

    }

    $TestGuestCredentials = "dir C:\. »


    Invoke-VMScript - VM $vm GuestCredential - $GuestCred - $TestGuestCredentials ScriptText

    } - ArgumentList, $vm, $GuestCred, $session, $vcentre | FT

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

    Using the foregoing in powercli 6 that the work never ends.  It's as if the connect-viserver command causes a response that requires intervention and locks work.


    If I remove the connect-viserver in the work section - it full well.

    Any ideas would be very appreciated!

    See you soon

    Have you tried switching of warning messages via the cmdlet Set-PowerCLIConfiguration , the DisplayDeprecationWarnings parameter?

  • Connect-VIServer throws the invalid URI error in the Studio of Powershell, but is very well outdoors

    I don't know if it's a problem of Powershell Studio 2014 or PowerCLI, but other people have reported the "invalid URI: the hostname could not be parsed" error, so I'll start here.

    I have a PowerCLI 5.0.1 on Windows 7, Powershell v2.0 and Powershell Studio 2014.

    In my script, when I run the Connect-VIServer-Server $server command, the command fails and generates the invalid URI error.  However, when I run my script in the command window PowerCLI, the script works fine.

    I guess I have a problem of environment in the Studio of Powershell, but wonder what circumstances causes PowerCLI to raise this error.

    So far, I have not had much luck with Studio 2014 Powershell and PowerCLI, don't know if it's powershell v2.0 or something else.

    It looks like a Studio of Powershell environment problem.

    I have many ps1 files and use the point of supply to load the files ps1 in support which includes the call to connect-VIServer.  When I put the connect-VIServer in the file main ps1 I can connect to my vCenter, but when I put in the origin file, I cannot connect, nor can fact the fitting of test-work order.

    Thanks for the help.

  • How to make the Connect-VIServer cmdlet to always ask for username password

    Hi all

    I use the connect-viserver cmdlet to connect between host windows to my vcenter server.

    using

    The host - Powershell - 2.0, Windows XP, Powercli installed machine.

    Target machine - Vcenter server 4.1.0 on windows 2008 server, in the other subnet

    I want to have a provision that it must always ask for user name and password to connect.

    I took a look at

    http://pubs.VMware.com/vSphere-50/index.jsp?topic=/com.VMware.wssdk.apiref.doc_50/Vim.virtualmachine.html

    resultof = % 22connect - viserver % 22 & http://pubs.VMware.com/vSphere-50/index.jsp?topic=/com.VMware.PowerCLI.cmdletref.doc_50/connect-VIServer.html

    But failed to get the relevant information.

    Any ideas?

    Thank you

    Madalena

    Bangalore-India

    My mistake, Connect-ViServer does not accept a SecureString. You first need to convert it

    Try it like this

    $userName = "username"
    $passwd = Read-Host ("Password for " + $userName) -AsSecureString:$true
    $cred = New-Object System.Management.Automation.PSCredential -ArgumentList $userName,$passwd
    Connect-VIServer -Server MyServer -Credential $cred
    
  • Ideas re: ' Connect-VIServer: could not connect using the requested protocol "failure

    I know, it's a matter of weakness, but I hit the wall on this one. I've even got desperate enough that bouncing private LuD, and I tried everything we discussed, but I'm still @ deadlocked.

    I developed and tested several scripts that I am finally ready to go with Prod.

    I get this error when I am trying to connect to Vcenter server or host of the cmndline of vitoolkit (and obviously in scripts).

    «Connect-VIServer: could not connect using the requested protocol.»

    I'm runing the vitoolkit FROM the server VCenter, so I wouldn't exepct the local to be a problem connection. I expect calls the ESX servers as questions) (we have several firewalls in the game). But even once, on-site I would not expect a problem.

    I checked my ports of VC and even more precisely called listener in the connect command, but it does not help.

    I tried to watch the ports through various lines of command, but I don't see anything.

    Any suggestions?

    Add - confirm: $false and it won't be quick.

    =====

    Carter Shanklin

    Read the PowerCLI Blog
    [Follow me on Twitter |] http://twitter.com/cshanklin]

  • Unable to connect using Connect-VIServer

    I am new to use VI Toolkit for Windows.

    When I issue the command Connect-VIServer-server localhost-protocol https - tim.lewis username-password password

    I get:

    "Unable to connect to the VI server: https://locahost:443 / sdk with tim.lewis of the user."  Connection failed due to bad user name or password. »

    I'm using the correct user name and password.

    Hello

    You try to connect to VC with username 'tim.lewis '. Looks like you can use the username with the dot and the mistake of user password wrong name. We tried to connect to ESX directly with a user name with the point and got the same error, although able to connect with ESX using VI Client using the username with point in (like your tim.lewis).

    Thank you

    Christel

  • When Windows starts it is always a dialogue box that flashes on the screen and the CPU usage high (above 50%), after I connect sometimes for several minutes.

    Original title: at the start of Windows there is always a dialogue box that flashes on the screen, but I've known idea what it is.

    How can I determine which program is using this dialog box? I also don't expect high utilization of the processor (over 50%) after that I connect sometimes for several minutes. I see not all applications running in the Task Manager. The amount of CPU utilization in the services tab doesn't match what I see compared to what the gadget is read in my sidebar. Any ideas?

    Thanks in advance

    Hi Soan,

    1. What is exactly mentioned in the dialog box?

    2. when the problem started?

    3. did you of recent changes on the system?

    Method 1:

    Step 1:

    You can check if the problem occurs in safe mode.

    Start your computer in safe mode

    Step 2:

    If you are not faced with the question in safe mode, you can perform a clean boot and check.

    A clean boot to check if startup item or services to third-party application is causing this issue.

    You can read the following article to put the computer in a clean boot:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    After the troubleshooting steps, please refer to clean the boot link to put the computer to normal startup mode.

    Method 2:

    You can read the following article and perform a full scan of security on your computer.

    Microsoft safety scanner

    Note: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss. You can take a backup of important data before performing analysis.

    Method 3:

    You can also read the following article and try to optimize the performance of Windows Vista.

    Optimize the performance of Microsoft Windows Vista

    Hope this information is useful.

  • error message ' Add printer. Connect to the printer. Windows cannot connect to the printer. Operation failed with error 0x0000007e"___Any ideas?

    trying to access a lexmark printer installed on xp based computer from a laptop running windows7 via a local network.  Although the network is configured correctly, when I run the Windows printer installation I get an error message ' Add printer.  Connect to the printer.  Windows cannot connect to the printer. Operation failed with error 0x0000007e"I just upgraded to Vista by using the upgrade Acer and had the problems that Windows tried to download the drivers from Lexmark-, but could not. [the same lexmark printer and the configuration worked without any problems before the upgrade on this combination of machines running vista and xp].

    I had a similar problem when I tried to connect to an hp printer that used a Vista driver. Could do this test? Download Windows 7 driver from Lexmark, install it, and then try to connect to the printer again. Andre Da Costa http://adacosta.spaces.live.com http://www.activewin.com

  • Several VSS writers fail and my backups are failling too. Need help!

    Several VSS writers fail and my backups are failling too. Need help:

    I have a desltop installed SP3 x 64 XP and a laptop with seven x 64 SP1. In both the machine that my backups fail. I'm trying to back up data by using boats to storage, backup Windows also is failling. I'm taking a full backup on a USB external drive (2 TB).

    I did "vssadmin list writers" and showing several writers are in the failed State.

    I've done SFC/scannow, it did not help. There is no error in the disk and Chkdsk.

    I don't know how VSS works and how to solve the problem. Help, please!

    A lot of people told me they found this informative article. That's why I upgraded that and display back again.

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

    Before you stat is working on this issue make sure that the volumes have no system disk/file error. Run Chkdsk and ensure.

    (1) in the case of a failure of backup/writer, we first check the drivers associated with the VSS backup.

    These drivers are:

    VOLSNAP. SYS

    NTFS. SYS

    SWPRV. DLL

    -Check the version of above mentioned MS 3 files and update using MS Hotfix.

    If we have installed other suppliers, who might be the supplier of StorageCraft, Symantec suppliers and suppliers of Acronis, he must ensure that their files are also updated.

    Note: You can see the list of suppliers using this command: VSSADMIN LIST PROVIDERS

    Some of the DRIVERS PROVIDER commonly find are:

    stcvsm.sys

    symsnap.sys

    snapman.sys

    (2) this step is performed only when we find him

    VSS writers in a failed State. If we find the stable writers and backups still fail, or we get errors, do not perform this step if you please.

    In this case, the VSS writers fail, we can delete the following registry key, after of course saving and restart the server.

    HKLM/Software/Microsoft/EventSystem/{26c.../Subscriptions.

    This key will be automatically recreated when you restart and writers should return to the stable state.

    The writers pending the completion status is not a problem. It's also good that Stable.

    We can do on the Server 2003, 2008 and 2008 R2 OS as well.

    However, in Windows Server 2003, after you delete and restart the "vssadmin list writers" server cannot display all the writers, in this case must register the dll:

    For a list of the dll files to register, please check KB: http://support.microsoft.com/kb/940184

    Note: The reinstatement of dll in Windows Vista/2008 and especially is NOT recommended.

    (3) if we have only one / specificwriter (s) in a State of failure, which would always be SQL, EXchange, IIS or NTDS, then we have need to revive their respective service Console of service.

    If they fail repeatedly, then make sure that the application and its components are updated. See their respective engineers immediately. Make sure that the latest service packs and patches are installed.

    (4) make the foregoing, resolves generally 80 to 90% of the questions. If we believe that the issue is occurring, or we have VSS event errors, it may be the providers, the origin of the problem. If the creation of the snapshot does not properly, it can affect writers and other components involved.

    Please check providers using "vssadmin list providers. If we find any other provider, other than the Microsoft software shadow copy provider, we have to remove from the list.

    To do this: start the registry editor.

    HKLM/System/CurrentControlSet/Services/VSS/suppliers/GUID.

    One GUID would be for Microsoft Software Shadow Copy provider. The other GUID would be for other providers such as StorageCraft. We will save the GUID, and then delete it. Then restart the machine.

    Now when we do vssadmin list providers, we will see only the default Microsoft provider.

    I have seen in many cases where our supplier of StorageCraft may not work properly and continue of not not the authors. In such

    case, if we get rid of the supplier, then the issue is resolved and not re occurs.

    -However this would impede the functionality of StoaregCraft or any other similar to this backup software.

    That's why to engage respective software tech support for further assistance.

    (5) If a shadow copy is enabled on the volume, make sure that the storage area is set to the default location.

    For example:

    If we take a snapshot of C: then the storage area should be C:

    We are changing that, if we do not have enough free space (at least 300 MB) free.

    We can click with the right button on the volume, goto the cliché tab and change it accordingly.

    Also note that the minimum value of the storage area should be 300 MB and maximum can be 3000 MB.

    We can also set any value between the two, which is a multiple of 300, 600, 900, 1200, 1500 etc... According to the available space.

    In the cases where errors in the event viewer on wait times (event id: 12298, 12310, 2004, 12290) then we also need to put the MinDiffArea in the registry.

    HKLM/System/CurrentControlSet/Services/Volsnap

    Right side, new DWORD VALUE - "MinDiffAreaFileSize" - change and set the value between "300-3000 Mo" or any multiple

    300 between the two. Ideally, we can define it on 3000 MB which works even better if we have space.

    Ref: http://support.microsoft.com/kb/826936

    (6) also, please make sure we have plenty of free space. If we go by the book, a snapshot requires at least 10% of the volume

    to be free.

    Storage controllers (SCSI/RAID controllers) could also be a problem and may need to be updated.

  • When you connect 1 or several external USB drives, why is the letter a * shoot?

    When you connect 1 or several external USB drives, why is the letter a * shoot? Referencing external drives through library (Windows V7) becomes a really shiny, totally useless feature without consistency of drive letter. Or unnecessary to be a design goal? I almost had it still works but who finally to 3 minutes). What it will take to make useful new features?

    Windows assigns the first available on the first hard drive connected and one drive letter to another and so on.  Always has, always will. What will help sometimes (but), is to open disk from an elevated command prompt management and adversely affect permanent a letter from your external drive which is much higher than the letters in use.  This will often allow the will to keep a letter.

  • Connection Internet drops several times every 5 to 15 minutes

    Connection Internet drops several times every 5 to 15 minutes.  It is an old ASUS week ultrabook computer that is running Windows 7 Home Premiuim.  The problem is not the network as 4 other wireless computers work properly. Also, same problem is observed on the other two networks.  Only change in the computer as he received is the addition of Kapersky anti-virus and Microsoft Office 2003.  Problem seems to be with Windows 7.  The yellow triangle of death appears on connection bars when the problem occurs.  Disconnect and reconnect the Internet solves the problem for another 5 to 15 minutes.

    It seems to me that it is a possible driver with the card built into your new laptop wireless. You can consider using Device Manager to check to see if there are problems reported with the wireless adapter. Also, I suggest that you visit the manufacturer of the laptop and get the latest available wireless drivers for that brand and model.

    You could also have a hunt in the event log and see if there is any additional details that might shed some light as to why the wireless network has decreased. That his fall is one thing, but the log events might suggest a few reasons for this.

  • "Unable to connect to the printer. Operation failed with error 0 x 00000866", setting up a network printer

    Title of the Moose: error 0 x 00000866

    I have a laptop with windows 7 Professional.

    When I try to install a network printer I always get the message "cannot connect to the printer. Operation failed with error 0 x 00000866.

    What can I do to fix this

    Hi ETPM.

    You can try the following steps and check if it helps.

    Method 1:

    You can try to start troubleshooting printer and check.

    Check out the link:

    Open the printer Troubleshooter:

    http://Windows.Microsoft.com/en-us/Windows7/open-the-printer-Troubleshooter

    Method 2:

    Error message when you try to install a network printer on a Windows Vista-based computer: "Windows cannot connect to the printer operation cannot complete (error 0x0000000d).

    http://support.Microsoft.com/kb/947236

    Note: You can read this article and try to proceed as for Windows 7 also.

    Important: Serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow the steps in the link mentioned above carefully. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs.

    For more information about how to back up and restore the registry, follow the steps from the link below:

    http://Windows.Microsoft.com/en-us/windows7Back-up-the-registry

    Method 3:

    If the fix above is unable to get the printer working on your client machine to vista, so I suggest to follow the steps mentioned by Afzal Taher as of Friday, December 18, 2009 02:00.

    http://social.answers.Microsoft.com/forums/en/w7network/thread/954c4b9d-2F4C-4b1b-8fb6-49204ed96dfc

    Also check out the link:

    Install a printer:

    http://Windows.Microsoft.com/en-us/Windows7/install-a-printer

    Hope this information is useful.

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Need to export Connect-VIServer drive and import it for later use

    Hello

    I'm trying to export Connect-VIServer on disk:

    $vcenterconnection = Connect-VIServer-Server vcenterserver

    $vcenterconnection | Export-Clixml-path C:\TEMP\session.xml

    I want to import the session exported to a new process of powershell that it connects faster to vcentern later:

    $ImportedSession = import-Clixml-path C:\TEMP\session.xml

    I can access all the properties of the imported object that before exporting it.

    $NewConnection = Connect-VIServer-Session $ImportedSession - Server vcenterserver

    It does not work:

    SE connect-VIServer: 23.11.2015 14:11:17SE connect-VIServerUnable to connect to the VI server: https://vcenterserver/SDK using session Id: "vcenterserver"On line: 1 char: 22

    Is there a way to export a vCenter session on the disc to reuse it in a new process of powershell?

    Thank you

    For the parameter of the cmdlet Connect-ViServer Session you must pass a Guid.

    Your current logon, you can retrieve this Guid

    Global $: DefaultVIServer | Select - ExpandProperty SessionId

    Note that when you want to reconnect, that these sessions have a time-out value.

    They don't stay open forever (normally).

Maybe you are looking for