VMware.VimAutomation.VdsComponents
I'm looking for a script that will list the security policy for the Exchange vDS. I installed the vDSPowerCli but get this error. Œuvres for powershell 32 bits, but not on 64-bit.
Add-PSSnapin: Windows PowerShell "VMware.VimAutomation.VdsComponent" snap-in is not installed on this computer. To E:\Scripts\HealthCheck - Pramod\dvswitch_1.ps1:1 tank: 13 + Add-PSSnapin < < < < VMware.VimAutomation.VdsComponent + CategoryInfo: InvalidArgument: (VMware.VimAutomation.VdsComponent:String) [Add-PSSnapin], PSArgumentExcepti on + FullyQualifiedErrorId: AddPSSnapInRead, Microsoft.PowerShell.Commands.AddPSSnapinCommand Any solution?
With the Export-Csv cmdlet.
Something like that
&{foreach($dvSw in Get-VirtualSwitch -Distributed){ Get-VirtualPortGroup -Distributed -VirtualSwitch $dvSw | Select @{N="dvSw Name";E={$dvSw.Name}}, @{N="dvSw AllowPromiscuous";E={$_.ExtensionData.Config.DefaultPortConfig.SecurityPolicy.AllowPromiscuous.Value}}, @{N="dvSw ForgedTransmits";E={$_.ExtensionData.Config.DefaultPortConfig.SecurityPolicy.ForgedTransmits.Value}}, @{N="dvSw MacChanges";E={$_.ExtensionData.Config.DefaultPortConfig.SecurityPolicy.MacChanges.Value}}, @{N="dvPg Name";E={$_.Name}}, @{N="dvPg AllowPromiscuous";E={$_.ExtensionData.Config.DefaultPortConfig.SecurityPolicy.AllowPromiscuous.Value}}, @{N="dvPg ForgedTransmits";E={$_.ExtensionData.Config.DefaultPortConfig.SecurityPolicy.ForgedTransmits.Value}}, @{N="dvPg MacChanges";E={$_.ExtensionData.Config.DefaultPortConfig.SecurityPolicy.MacChanges.Value}} }} | Export-Csv C:\report.csv -NoTypeInformation -UseCulture
Tags: VMware
Similar Questions
-
Problem when I add add-PSSnapin VMware.VimAutomation.Core
Hi guys,.
IM new in the world of cli power!
Hi guys,.
IM new in the powercli world I need help and reading/practice a lot.
I have a problem when creating a task sheduler in W2K8R2, I got an error and the folowwing param is not
recognized by the script when I add the add-PSSnapin VMware.VimAutomation.Core cli
:
(param
[String []] $vCenters
)
When I remove the script recognize the param!
----------------------------------------------------
Add-PSSnapin VMware.VimAutomation.Core
(param
[String []] $vCenters
)
$fecha = get-date - uFormat "%d %m %y.
I check a few posts with people who have the same problem but I can't find the solution.
I need but a joker?
Thank you very much
Carlos
You can add a name of file datetime stamp. Like this
$alarmas | out-file "C:\ReportesvCENTER\Vcenter_report-$(Get-Date-f yyyyMMdd-hhmm)-$fecha.txt.
You can avoid the PSSnapin error using Try-Catch construction, that I gave earlier.
Have you really tried that?
-
vCO with Powershell and causing VMware.VimAutomation.Extensions to workflows to hang
Environment:
vSphere Version: 5.5
vCO Version: 5.5.0 build 1281930
PowerShell Plugin: PowerShell 1.0.3.304
I have successfully instantiated several Powershell commands in by vCO in the past, including commands PowerCLI. However, when I use the
"import-module VMware.VimAutomation.Extensions.
command, the workflow seems to stop. I need this module in order to obtain information of vSAN.
I know that the module is supposed to be implicitly imported without the need of the declaration when running in a PowerShell command prompt, but I've also had instances where I know that the line is necessary, especially when a Powershell script requires that the module is called from the command line.
It seems to be the case here because removing the line causes an error "unknown cmdlet", when it tries to parse the command "Get-VsanDiskGroup".
Any help would be greatly appreciated! Thank you.
Solution:
Add: ' Get-childitem
| unlock file "before:" import-module VMware.VimAutomation.Extensions
-
Why everyone says "Add - PSSnapin VMware.VimAutomation.Core"?
Every thread I've read says you have to set the "Add-PSSnapin VMware.VimAutomation.Core" at the top of any script or commands if you want to run PowerShell (and not PowerCLI).
However, when I add my script, PowerShell (2.0) will continue on and run the script, but he's going to throw me a beautiful big red alert (I guess this isn't a mistake, because the script runs in the end), by saying that "VMware.VimAutomation.Core" is already included and therefore cannot be added again.
I have never anything to set up or change PowerShell, ever. In fact, it's only as day 2 of using PowerShell. It is therefore in its straight-out-of-the-box condition. Yet all the forums I'll just goes on and on the way in which this is necessary and other things. I was wondering, what gives? What is the history/explanation here? Should I just sort of Monster mutant version of PowerShell?
Add to ensure that it is responsible in case it is not. Some applications (e.g., PowerGUI) allow you to load the snap-ins by default by removing the need to add to each script. If you do not add it to your scripts and it is not loaded and you attempt to run commands PowerCLI operations fail because orders will not be know. People consider it generally a best practice to include the snap at the beginning of scripts is easier to transport.
-
After the VMWARE Powercli guide Frustration
$newvm.vmwareNEW.newvm | foreach {New-VM-name $_ .name-model $_.} Tmp - StorageFormat $_. SF - Datastore $_. DS - VMHost $_. VMH | set-vm - memorygb $_. RAM - numcpu $_. CPU-confirm: $false | Get-hard drive | together-hard drive - data store $_. DS - StorageFormat $_. SF - CapacityGB $_. HD-confirm: $false | new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NHD-confirm: $false | new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NNHD-confirm: $false | new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NNNHD-confirm: $false | new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. {NNNNHD-confirm: $false}
It comes to getting the error message:
WHY the name argument is empty?
New-VM: could not validate the argument on the parameter 'name '. The argument is null or empty. Provide an argument that is not
null or empty and then try the command again.
On line: 1 char: 48
+ $newvm.vmwareNEW.newvm | foreach {New-VM-Name $_.} Name - model $_. Tmp-storage...
+ ~~~~~~~
+ CategoryInfo: InvalidData: (:)) [new-VM], ParameterBindingValidationException)
+ FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
It has been chewed when it has been posted on the forum so I had a go at reformatting. I also added the missing "get-content" to load the XML file (which may explain why you receive the question "empty or null.")
[xml] $newvm = Get-Content prophix.xml
newvm.vmwareNEW.newvm | foreach {'}
New-VM-name $_ .name-model $_. Tmp - StorageFormat $_. SF - Datastore $_. DS - VMHost $_. VMH | `
set-vm - memorygb $_. RAM - numcpu $_. CPU-confirm: $false | `
Get-hard drive | together-hard drive - data store $_. DS - StorageFormat $_. SF - CapacityGB $_. HD-confirm: $false | »
new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NHD-confirm: $false | »
new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NNHD-confirm: $false | `
new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NNNHD-confirm: $false | »
new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NNNNHD-confirm: $false '
}
Other things that likely are not what you want...
- Line 3 - the VMH value in the XML file looks like to try a couple of queries to find a VMware host for the virtual machine. A number of things that do not work
- The value of VMH will not be executed, so it will try to find a host named "(production de get-cluster |)" Get-vmhost | (get-random) ' rather than the command and returning a value
- If the cluster is active DRS it's easier to use - ResourcePool (get-cluster production) and let the DRS know where to place the virtual computer. By practice (production of get-cluster | get-vmhost | get-random) the code can try and place the new virtual machine on the hosts that are down, disconnected or in maintenance mode (and fails), while DRS will avoid the hosts for the initial investment
- Line 4 - code seems to assume that $_ always object references a 'newvm' from the XML file. This isn't happening, rather each time you "pipe" $_ done refers the previous result. So the line $3 _ is a newvm object and things like $_.name work as expected. Online $4 _ is now being VM returned by New - VM, not the newvm object from the XML file. So things like $_. RAM and $_. CPU will be null since $_ is not what the script expects it to be.
- Line 6 - here is an object pipeline as new hard drive is powered a hard disk object in the pipeline (all-hard drive has returned an object of hard drive) and new-harddisk cannot use a hard drive as the input object (will throw an error "the input object cannot be bound"). The other issue is $_. SF and $_. NHD will $Null because what is in the pipeline is not an object 'newvm '.
- Line 6-9-only the first entry in the XML file has several entries of size of hard disk (NHD, NNHD, etc.). The code will trigger errors when you try to create virtual machines with less than 4 drives as the CapacityGB will (try) to be set to $Null that is not valid
-
PowerShell remoting to install VMWare tools
Greetings
It is true that it is probably focused more on PowerShell and less on VMware VMware tools is the target
I'm trying to write a script to install VMware tools remotely on the virtual machines that do not have VMware tools installed.
So far I have the below...
Import-Module VMware.VimAutomation.Cis.Core
Import-Module VMware.VimAutomation.Core
Import-Module VMware.VimAutomation.HA
Import-Module VMware.VimAutomation.Sdk
Import-Module VMware.VimAutomation.Storage
Import-Module VMware.VimAutomation.Vds
Se connect-VIServer vCenterserver.domain
$username = "domain\username"
$SecurePassword = Read-Host -Quick ' Enter * FIELD * password " -AsSecureString
$Credentials = New-Object System.Management.Automation.PSCredential '
-ArgumentList $UserName $SecurePassword
$VM = "Test01"
Get-vm $VM | Dismount-Tools
Get-vm $VM | Mount-Tools
$RMsession = New-PSSession -ComputerName $VM -Credential $Credentials
Invoke-Command -Session $RMSession -ScriptBlock { }$CDRom = Get-WmiObject -class Win32_CDROMDrive | select Drive | ForEach {$_. {{ Drive}}
{ Invoke-Command -Session $RMSession -ScriptBlock { }$Subpath = '\setup.exe s-v - SB ADDLOCAL = all THE REBOOT = R'}
{ Invoke-Command -Session $RMSession -ScriptBlock { }$ExecuteEXE = Join-Path -Path $CDRom -ChildPath $Subpath}
{ Invoke-Command -Session $RMSession -ScriptBlock { }start-process $executeEXE}
output
Remove-PSSession *
Disconnect VIServer * -confirm:$False
I confirmed that $executeEXE = indeed Z:\setup.exe s - v - SB ADDLOCAL = ALL REBOOT = R
When I run the script in the ISE, I get:
Start-Process: this command cannot be executed due to the error: the system cannot find the specified file.
Online: 1 character: 14
+ start-process < < < < $executeEXE
+ CategoryInfo: InvalidOperation: (:)) [Start-Process], InvalidOperationException)
+ FullyQualifiedErrorId: InvalidOperationException, Microsoft.PowerShell.Commands.StartProcessCommand
It is true that I am very inexperienced with PowerShell remoting.
It seems that when I run the script it seems in fact be invoking the command on the remote computer, but rather on the local computer. VMware tools are piling up and the path in $executeEXE is 100% correct and the PSSession is also open, no doubt, but not magic?
Any guidance would be greatly appreciated.
Greetings LucD
Looks like I may have found the problem.
Looking for a way run the background process, so that I can do a get-process, while he was running to show he was running, I discovered that start-process allows you to specify the - ArgumentList parameter. (windows - start a detached in PowerShell background process - Stack Overflow) (2 responses)
So, it looks like this:
Invoke-Command - Session $RMSession - ScriptBlock {"$CDRom = Get - WmiObject - class Win32_CDROMDrive | select drive"}
| ForEach {$_.} Disk}; $Subpath = '\setup.exe '; $ExecuteEXE is $CDRom join-Path-Path - ChildPath $Subpath;. start-process $executeEXE - ArgumentList's - v - SB ADDLOCAL = ALL REBOOT = R'}
To my surprise translates:
[Test01]: C:\ PS > Get-Process of installation *.
Manages the NPM PM (K) k VM (M) CPU Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
68 10 1540 5088 56 3220 0.17 setup
108 10 2324 7340 76 0.14 3504 setup64
And VMware tools installed.
Thank you very much for your time and trouble. Always very appreciated!
-
I am trying to get an error control when taking a 'new-snapshot' of a virtual computer (protected by SRM), see code below:
$VMname = < VMname >
$snapname = < nom_snapshot >
try {}
Get-VM-name $VMname | New-Snapshot - name $snapname - memory - suspend - ErrorAction Stop
"SNAPSHOT - OK | Tee-Object - FilePath $logPath - add
}
catch
{
$_ | Tee-Object - FilePath $logPath - add
'INSTANT mislukt along | Tee-Object - FilePath $logPath - add
Output 1
Break
}
The code is a failure for the VM that are protected with SRM and I get the error:
New Snapshot: 25/02/2015 11:47:28 New-Snapshot, the method is disabled by "com.vmware.vcDr".
To C:\Tools\Windows_Updates\CreateSnapVM - Copy.ps1:34 tank: 27
+ Get-VM-name $VMname | New-Snapshot - name $patchname - memory - suspend - ErrorA...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo: NotSpecified: (:)) [new-screenshot], MethodDisabled)
+ FullyQualifiedErrorId: Client20_VMServiceImpl_CreateSnapshot_ViError, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewSnapshot
Anyone any idea how the GET some errorcontrol custom "New-snapshot" for SRM protected VM?
Any help appreciated.
Are you sure that you are trying to perform this operation on the protected virtual machine and not the placeholder VM?
-
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))}}
-
Stop virtual machines with or without VMware tools installed
So after a power failure major where I work has taken place where the batteries of the UPS only ran about 10 minutes and the emergency generator didn't kick in, I was put in charge of writing a script that starts to stop the virtual machines and servers in a given cluster. Now that I am relatively new to the environment here, so I don't know if all the virtual machines have the tools are installed. I want to cover all bases and the virtual machines that do not have the tools installed. My script done now is it initiates closing the comments on all the virtual machines and check every 10 seconds to 120 seconds for virtual machines go offline if after 120 seconds, there are even virtual machines online, it issues a shutdown command on all servers that have not stopped. Now, he'll catch all the virtual machines, but I don't want the machine have to wait 2 minutes before totality if it can be avoided (remember that this script will be executed when the data center goes to the power of the UPS for every watt account to keep critical systems online). the script throws an error when it cannot stop because no tool is installed, so I thought I could use a try/catch block to catch the error and send just a detroit of turning control of these VMs off. I tried to do, but without success.
Is it possible that I can either catch the error, or a stop all virtual machines that do not have the tools installed?
Attached is my code, maybe you can spot what can I do to stop the virtual machines without tools within the do / while loop when errors occur first.
Add-PSSnapin VMware.VimAutomation.Core$server = $args [0]$cluster = $args [1]SE connect-VIServer-Server $server$counter = 0{}If (Get-Cluster-name $cluster | get - vm | where {$_.powerstate - eq 'receiving'}) {}If ($counter - eq 0) {}Get-Cluster-name $cluster | get - vm | where {$_.powerstate - eq "receptor"} | stop-VMGuest-confirm: $false}Write-Host "VMs are on waiting" (120-$counter)"seconds"$counter = $counter + 10Sleep 10}}While ($counter - 110)-or ((Get-VMHost |)) Get - VM | where {$_.powerstate - eq "receptor"}) .count)-No 0If ($counter = 120) {}Write-Host "certain virtual machines did not not stop properly, tension now.Get-Cluster-name $cluster | get - vm | where {$_.powerstate - eq "receptor"} | Stop-VM-confirm: $false}Write-Host "Putting servers into maintenance mode."Get-cluster-name $cluster | Get-vmhost | where {$_.state - eq 'connected'} | Game-VMHost-State "Maintenance".Sleep 10Write-Host "stop servers."Get-cluster-name $cluster | Get-vmhost | where {$_.state - eq 'Maintenance'} | Stop-VMHost-confirm: $falseDisconnect-VIServer-confirm: $falseTry something like this
$vm = Get-VM $vm | where {$_.Guest.State -eq "Running"} | Shutdown-VMGuest -Confirm:$false $vm | where {$_.Guest.State -eq "NotRunning"} | Stop-VM -Confirm:$false
Virtual machines running VMware tools will get a judgment of comments, while the virtual machines that do not have the VMware tools running, will get a poweroff.
-
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.NewDrsRuleThank 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
-
Copy the files from ESXi vmware.log
All,
Need a bit of help here. We were asked to keep the vmware*.log files in the folder of each VM. Using the viToolkitExtensions, I can get the files in each directory, but I can't get copied off in my server Windows so that they can be saved. It has been suggested that I use TkeDatastoreFile copy, but I ran into a wall, make it work. Here's what I have so far, once connected to the VC.
$x = get-VM VMNAME | Get - views | % {$_.config.files.vmpathname}
$y = $x Extract-TkeDatastorePathElements
$z = get-datastore $y.datastore | Get-tkedatastorefile | where {$_ .path - like "vmwareJournal"}
I can now browse each journal found in the folder, but I can't get copy-tkeDatastoreFile work to copy each file to a destination on the Server Windows where the script will run, for example D:\Data\logs. Any ideas on how I finish that?
Gary
Here's a transcript of a session that has worked for me. I added - noSize - noType and - noModification to Get TkeDatastoreFile because it speeds up things a bit.
C:\> get-datastore Name FreeSpaceMB CapacityMB ---- ----------- ---------- Storage1 48292 225536 C:\> get-datastore Storage1 | Get-TkeDatastoreFile -noSize -noType -noModification | Where { $_.Path -like "*.log" } Path Size Modification Datastore ---- ---- ------------ --------- [Storage1] esxconsole-49341a... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] esxconsole-49341a... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] esxconsole-49341a... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] esxconsole-49341a... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] esxconsole-49341a... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Win2k3/vmware-7.log 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Win2k3/vmware-8.log 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Win2k3/vmware-9.log 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Win2k3/vmware-10.log 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Win2k3/vmware-11.log 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Win2k3/vmware-12.log 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Win2k3/vmware.log 0 1/1/0001 12:00:00 AM Storage1 [Storage1] t/Win2k3/vmware-1... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] t/Win2k3/vmware-2... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] t/Win2k3/vmware-3... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] t/Win2k3/vmware-4... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] t/Win2k3/vmware.log 0 1/1/0001 12:00:00 AM Storage1 [Storage1] t/Ubuntu 8.04/vmw... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] t/Ubuntu 8.04/vmw... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] t/Ubuntu 8.04/vmw... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Ubuntu 8.04/vmwar... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Ubuntu 8.04/vmwar... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Ubuntu 8.04/vmwar... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Ubuntu 8.04/vmwar... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Ubuntu 8.04/vmwar... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Ubuntu 8.04/vmwar... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] 2k8 64 bit/vmware... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] 2k8 64 bit/vmware... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] ESXi 3.5 Master I... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] ESXi 3.5 Master I... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] ESXi 3.5 Master I... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] ESXi 3.5 Master I... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] ESXi 3.5 Master I... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] ESXi 3.5 Master I... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] ESXi 3.5 Master I... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] ESXi 3.5 Master I... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Openfiler/vmware.log 0 1/1/0001 12:00:00 AM Storage1 [Storage1] win2k3-64-vi4/vmw... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] win2k3-64-vi4/vmw... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] win2k3-64-vi4/vmw... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] win2k3-64-vi4/vmw... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] win2k3-64-vi4/vmw... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] win2k3-64-vi4/vmw... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] win2k3-64-vi4/vmw... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] ESXi 4.0 Master I... 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Demo VM 1/vmware.log 0 1/1/0001 12:00:00 AM Storage1 [Storage1] Stat VM/vmware.log 0 1/1/0001 12:00:00 AM Storage1 C:\> $allLogs = get-datastore Storage1 | Get-TkeDatastoreFile -noSize -noType -noModification | Where { $_.Path -like "*.log" } C:\> $z = $allLogs[40] C:\> $z Path Size Modification Datastore ---- ---- ------------ --------- [Storage1] win2k3-64-vi4/vmw... 0 1/1/0001 12:00:00 AM Storage1 C:\> $z.Path [Storage1] win2k3-64-vi4/vmware-8.log C:\> $datacenter = get-vm win2k3-64-vi4 | get-datacenter Get-VM : 2/20/2009 8:14:50 AM Get-VM VM with name 'win2k3-64-vi4' not found, using the specified filter(s). At line:1 char:21 + $datacenter = get-vm <<<< win2k3-64-vi4 | get-datacenter + CategoryInfo : ObjectNotFound: (:) [Get-VM], VimException + FullyQualifiedErrorId : Core_ContainerCmdletBase_ObjectNotFoundByName,VMware.VimAutomation.Commands.GetVM C:\> get-vm Name PowerState Num CPUs Memory (MB) ---- ---------- -------- ----------- ESXi 4.0 Master I... PoweredOff 1 2048 ESXi 4.0 Master I... PoweredOff 1 2048 ESXi 3.5 Master I... PoweredOff 1 1024 ESXi 4.0 Master I... PoweredOff 1 2048 ESXi 3.5 Master I... PoweredOff 1 1024 ESXi 4.0 Master I... PoweredOff 1 2048 ESXi 3.5 Master I... PoweredOff 1 1024 Stat VM PoweredOff 1 256 Win 2003 SP2 PoweredOn 1 1024 Ubuntu 8.04 PoweredOff 2 512 2k8 64 bit -- Los... PoweredOff 1 2048 Win2k3-64bit-VC4 PoweredOn 1 1024 Openfiler NSA 30Gb PoweredOff 1 512 ESXi 3.5 Master I... PoweredOff 1 1024 ESXi 3.5 Master I... PoweredOff 1 1024 C:\> get-vm Win2k3-* | get-datacenter Name Id ---- -- ha-datacenter Datacenter-ha-datacenter C:\> $datacenter = get-vm Win2k3-* | get-datacenter C:\> $z Path Size Modification Datastore ---- ---- ------------ --------- [Storage1] win2k3-64-vi4/vmw... 0 1/1/0001 12:00:00 AM Storage1 C:\> Copy-TkeDatastoreFile -source $z.Path -destination c:\temp.log -sourceDatacenter $datacenter
Note that I use $z.Path as the source, not the argument $z whole.
In addition, local files refer to files that are local to ESX, as they begin by.
-
PS does not recognize a specific code VMware?
I am using the ESX healthcheck powerscript for one of the positions, but the following error:
PS C:\Download\Healthcheck & gt; C:\Download\Healthcheck\Healthcheck.ps1
Add-PSSnapin: cannot add Windows PowerShell snap-in VMware.VimAutomation.Core
because it is already added. Check the name of the snap, and then try again.
C:\Download\Healthcheck\Healthcheck.ps1:59 char: 13
+ Add-PSsnapin & lt; & lt; & lt; & lt; VMware.VimAutomation.Core
The term 'initialize - VIToolkitEnvironment.ps1' is not recognized as a cmdlet, f
anointing, an executable program or script file. Check the term and try again.
C:\Download\Healthcheck\Healthcheck.ps1:60 tank: 36
+ Initialize - VIToolkitEnvironment.ps1 & lt; & lt; & lt; & lt;
The term 'connect-VIServer' is not recognized as a cmdlet, function, operable p
program, or script file. Check the term and try again.
C:\Download\Healthcheck\Healthcheck.ps1:61 tank: 17
+ connect-VIServer & lt; & lt; & lt; & lt; $vcserver
Attempted division by zero.
C:\Download\Healthcheck\Healthcheck.ps1:134 tank: 40
+ : ((100 * $ds.) round) FreeSpaceMB / & lt; & lt; & lt; & lt; $ds. (CapacityMB), 0)
The term 'disconnect-viserver' is not recognized as a command, function, operabl
e program, or script file. Check the term and try again.
C:\Download\Healthcheck\Healthcheck.ps1:205 tank: 20
+ Viserver unplug & lt; & lt; & lt; & lt; -confirm: $false
I have installed toolkit but I always have problems. Can anyone help?
Thank you very much
Stuart
The 'Beta' in there, it is certainly not what you want.
You can download and install the latest version.
-
VCenter discovery only works for Resource Pools
Hi all
In step 3 of the configuration wizard, I see a problem during the process of discovery of the infrastructure:
trying to find the resources of vCenter (data warehouses, ResourcePools, exchanges, etc.) only the task to discover ResourcePools succeed. All others fail. The status log for one of follows her chess (I decided to not to stick the newspaper of any situation, because for each failure messages are pretty much the same):
= Start Discovery vCenter =.
= Start discovered for the element of the platform: 10.0.4.135
Discover-> vCenter infrastructure, data warehouses has failed
The reason for the failure:
Error information
=================
Category: NotSpecified
ID: Client20_ConnectivityServiceImpl_Reconnect_Exception, VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer
Type: VMware.VimAutomation.ViCore.Types.V1.ErrorHandling.InvalidLogin
Message: 28/02/2013 10:01:12 Connect-VIServer cannot complete connection due to an incorrect user name or password.
Connect-VIServer: 28/02/2013 10:01:12 cannot be connect-VIServer comp
summer connection due to an incorrect user name or password.
At C:\Windows\Temp\PO_WorkingDir_15c278b0-3f49-49ee-a1c2-994183e147d7\PO_PSScri
pt_15c278b0-3f49-49ee-a1c2 - 994183e147d7.ps1:21 tank: 17
+ Connect-VIServer< -server="" $vcenteraddress="" -port="" $vcenterport="" -protocol=""> >
vCenterProtocol-the username-password $vCenterPassword - WarningActio $vCenterUsername
SilentlyContinue n | Out-Null
+ CategoryInfo: NotSpecified: (:)) [connect-VIServer], InvalidLog)
in
+ FullyQualifiedErrorId: Client20_ConnectivityServiceImpl_Reconnect_Excep
tion, VMware.VimAutomation.ViCore.cmdlets.Commands.ConnectVIServer
Discover-> vCenter infrastructure that has no data centers
The reason for the failure:
=================
Whereas the powers, targets and all the other entries of the task that is needed are the same for those who fail, that I am I missing?
Concerning
You can also check the Extended Properties of the vCenter target target and make sure that vSphere.PowerCLI.User and vSphere.PowerCLI.Password are set correctly. These are separate credentials from the user Runtime as they are used when Discovery must call PowerCLI. They usually take the form domain\username as username. You can easily test these credentials by trying to connect to the vClient with them. I would also check that this account has appropriate permissions, put in place in order to perform discovery, as Lee suggested.
-
As the pipeline input channels are not supported.
Guys, I have this script to add a vDisk to each virtual computer via one loop for each...
$VMNames = get-Content "E:\Code\Scripts\VMware-VM-UpgradevHardware\VM_Batch-1.txt".
# START the foreach loop
{foreach ($vm to $VMnames)
#Perform paraSCSI update
Write-Host $VM
Write-Host "Adding new CCG virtual disk..." »
# Get - Vm $vm | New-harddisk - CapacityKB 2048 - persistent persistence
$vm | New-harddisk - CapacityKB 2048 - persistent persistence
Read-Host «allows to pause and check...» »
. but when I run it, I get this error.
New hard drive: cannot process the transformation of argument on the parameter "VM". As the pipeline input channels are not supported.
E:\code\Scripts\VMware-VM-UpgradevHardware\pvSCSIUpdate3.ps1:55 char: 7
+ $vm | New-harddisk - CapacityKB 2048 - persistent persistence
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo: InvalidData: (EDM-SNEC - DBTEST:PSObject) [new-harddisk], ParameterBindingArgumentTransformationException
+ FullyQualifiedErrorId: ParameterArgumentTransformationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk
Allows to pause and check...:
Any suggestions?
You should have an object VirtualMachine (output of Get - VM) on the hose, if you want to send it to the cmdlet New-hard drive.
The concept of object by name (OBN) does not work for the channelling of entry here.
You can do
# START the foreach loop
foreach ($vm in (Get-VM-name (Get-Content "E:\Code\Scripts\VMware-VM-UpgradevHardware\VM_Batch-1.txt"))) {}
#Perform paraSCSI update
Write-Host $VM. Name
Write-Host "Adding new CCG virtual disk..." »
New-disk-hard - VM $vm CapacityKB - 2048 - persistent persistence
Read-Host «allows to pause and check...» »
}
-
Get-nicteaming of the distributed port group.
Hello.
I try to get nic teaming policy of dv port groups, but had issues with pipes (5.5, 5.5 dvswitch vsphere, powercli 5.5.0.6632):
PS C:\Windows\system32 > $dv = Get-VirtualSwitch-distributed
PS C:\Windows\system32 > $dv
Name NumPorts Mtu notes
---- -------- --- -----
1170 1500 dvSwitch
PS C:\Windows\system32 > $pgs = Get-VirtualPortGroup - VirtualSwitch $dv
PS C:\Windows\system32 > $pgs
Name key VLanId PortBinding NumPorts
---- --- ------ ----------- --------
dvSwitch-DVUplinks-44 dvportgroup-45 18 static
Management dvportgroup-46 128 static network
INET_UITIS_ephemeral dvportgroup-845 ephemeral 0
KSPD_ephemeral dvportgroup-846 ephemeral 0
GZ_Interconnect_ephemeral dvportgroup-843 0 ephemeral
INET_GUEI_ephemeral dvportgroup-844 ephemeral 0
VeeamISCSI_ephemeral dvportgroup-849 0 ephemeral
VeeamISCSI dvportgroup-92 128 static
Management_Network_eph... dvportgroup-847 0 ephemeral
ManNetwork_ephemeral dvportgroup-848 ephemeral 0
vMotion1 dvportgroup-51 128 static
KSPD dvportgroup-50 128 static
vMotion2 dvportgroup-52 128 static
GZ_Interconnect. static 128 dvportgroup-49
INET_UITIS dvportgroup-339 128 static
ManNetwork dvportgroup-47 128 static
INET_GUEI dvportgroup-48 128 static
Then, if I try this:
PS C:\Windows\system32 > $pgs | foreach ($dv Get-NicTeamingPolicy - VirtualSwitch - VirtualPortGroup $_)
I got an error on the conversion of 'VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.DistributedSwitchImpl' in 'VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualSwitch '.
If I try this:
PS C:\Windows\system32 > $pgs | foreach (Get-NicTeamingPolicy - VirtualSwitch $dv.name - VirtualPortGroup $_)
I got another error on the conversion of types of vportgroup 'VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.DistributedPortGroupImpl' in 'VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroup '. No luck with "..." -VirtualPortGroup $_.name' also, it says that I can not specify type string as input for - VirtualPortGroup.»
It seems that "get-nicteamingpolicy" comandlet cannot take dv types as input, but I don't know if.
Seems I forgot, you must use Get-VDUplinkTeamingPolicy to VDS switches
Because the code ends with the bad object in the pipeline, most of the time probably to iterate instead of trying to any pipeline. A small change in the XML file is necessary so that VMH is simply the name of the cluster (production). I have not tried running this code with your XML file, but it should give you a start to work from (the NHD, NNNHD, NNHD, etc. could be converted into a loop "foreach" If XML has changed so that there are multiple instances of the NHD element rather than the names of different elements for example)
[xml] $newvm = Get-Content prophix.xml
{foreach ($vm to $newvm.vmwareNEW.newvm)}
$CurVM = new-VM-name $vm.name - model $vm. Tmp - StorageFormat $vm. SF - $vm data store. DS - ResourcePool (get-cluster $vm. VMH)
$CurVM | set-vm - memorygb $vm. RAM - numcpu $vm. CPU-confirm: $false
$CurVM | Get-hard drive | together-hard drive - data $vm store. DS - StorageFormat $vm. SF - CapacityGB $vm. HD-confirm: $false
If ($vm. NHD - don't $Null) {}
$CurVM | new-harddisk - $vm data store. DS - StorageFormat $vm. SF - CapacityGB $vm. NHD-confirm: $false
}
If ($vm. NNHD - not $Null) {}
$CurVM | new-harddisk - $vm data store. DS - StorageFormat $vm. SF - CapacityGB $vm. NNHD-confirm: $false
}
If ($vm. NNNHD - not $Null) {}
$CurVM | new-harddisk - $vm data store. DS - StorageFormat $vm. SF - CapacityGB $vm. NNNHD-confirm: $false
}
If ($vm. NNNNHD - not $Null) {}
$CurVM | new-harddisk - $vm data store. DS - StorageFormat $vm. SF - CapacityGB $vm. NNNNHD-confirm: $false
}
}
Maybe you are looking for
-
Router Netgear feat - 08/10/2015
So apparently my router was hit in this recent exploit. I can't connect to my front door with my current password that worked the last time I logged in. This happens by Lastpass so I know that it is suppesed to be what I put it in (not "password"). A
-
Original title: Mail server Guys, I'm having trouble managing my mail server using Alt - N Mdeamon Mailing software with windows server 2012 R2... Can anyone suggest Me an alternative to that. Waiting for the answer
-
Cutting of duplex margin on 8500 wireless
Well, I recently got an Officejet Pro 8500 Wireless. I just found out that when I print duplex from my mac, the lower margins are clipped way upward. It does only on duplex printing. Y at - it a setting I need to change? How can I get around this?
-
MMS of Smartphones blackBerry and copy of sent Messages questions
Hello Got 2 questions abt my "BOLD". 1. I noticed that the MMS option is not available on my "BOLD". I bought the unlocked Australia Optus H/H and its use in the network of Telkomsel Indonesia. Telkomsel network has MMS ability but not sure abt Optu
-
My printer just stopped working - said that he had to be reset by turning it off, unplugging it, and then reconnect and turn it back on. I got the error message "0x6111bed". When I turn it back on, the error always, more he reminds me to reset using