Pinball's Posts

Thanks for the quick response Luc I'll wait in the wings then for the fix. Any suggestions on a workaround then, this VSAN thick/tin conversion is quite an issue and it seems like PowerCli is ... See more...
Thanks for the quick response Luc I'll wait in the wings then for the fix. Any suggestions on a workaround then, this VSAN thick/tin conversion is quite an issue and it seems like PowerCli is the only way. I'll ask William on his block what version he used to make it work. Johan
Hi All Trying to make use of William Lams great post on correcting VSAN Thick/Thin disk assignment but getting the following when trying to use the script or a single command. I've seen this... See more...
Hi All Trying to make use of William Lams great post on correcting VSAN Thick/Thin disk assignment but getting the following when trying to use the script or a single command. I've seen this on a similar pos related to consuming Tags. Environment: Client side = Windows 10 PowerCli Version = VMware vSphere PowerCLI 6.3 Release 1 build 3737840 vCenter = VCSA 6.0 U2 Build 3634794 Script source: http://www.virtuallyghetto.com/2016/06/heads-up-ovfova-always-deployed-as-thick-on-vsan-when-using-vsphere-web-client.html Error: PowerCLI C:\Scripts> Get-SpbmStoragePolicy -Name "my" Get-SpbmStoragePolicy : 26/07/2016 14:47:01    Get-SpbmStoragePolicy        Index was outside the bounds of the array. At line:1 char:1 + Get-SpbmStoragePolicy -Name "my" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [Get-SpbmStoragePolicy], VimException     + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Storage.Commands.Cmdlets.Spbm.GetStora    geProfile Running the full script: (modified the line with the vc connection details and the line where the vm is listed. PowerCLI C:\Scripts> .\Set-VSANPolicy.ps1 Applying VSAN VM Storage Policy: Virtual SAN Default Storage Policy to DLTGIT01 ... Get-SpbmEntityConfiguration : 26/07/2016 10:13:37    Get-SpbmEntityConfiguration        Index was outside the bounds of the array. At C:\Scripts\Set-VSANPolicy.ps1:25 char:53 + ... onfiguration -Configuration (Get-SpbmEntityConfiguration $hds) -Stora ... +                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [Get-SpbmEntityConfiguration], VimException     + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Storage.Commands.Cmdlets.Spbm.GetSpbmE    ntityConfiguration Set-SpbmEntityConfiguration : Cannot validate argument on parameter 'Configuration'. The argument is null or empty.
Hi All Does anyone know if it's possible to change the working directory of powercli when used asa powercli proxy? As part of out vRA & vRO implementation we make use of a PowerCli Proxy to... See more...
Hi All Does anyone know if it's possible to change the working directory of powercli when used asa powercli proxy? As part of out vRA & vRO implementation we make use of a PowerCli Proxy to do some AD,DNS work for us. Unfortunately by default it makes use of %TEMP% and our corporate standard is not to allow any newly create files in %TEMP% I'm looking for a way to change this not to try and create files in %TEMP% but rater a different directory not blocked. Sample Log extract: C:\Users\srvvmware\AppData\Local\Temp\vmware18\vco_vmware131.ps1 Thanks Johan
Hi MadMax01 Thanks for the reply, doesn't matter what i try i always get "0" events, but when i just do a "Get-VIEvent" i get the events i'm interested in for the last few days. Just not able ... See more...
Hi MadMax01 Thanks for the reply, doesn't matter what i try i always get "0" events, but when i just do a "Get-VIEvent" i get the events i'm interested in for the last few days. Just not able to display the count  for yesterday. Johan
Hi there Below is a part of a much bigger script I use to get some vm capacities from 14 different virtual centers and then write the results back to a sql database for reporting. The inten... See more...
Hi there Below is a part of a much bigger script I use to get some vm capacities from 14 different virtual centers and then write the results back to a sql database for reporting. The intention is to get the number/quantity of vm's created and deleted by cluster on a daily base. I've got the below but the result is always 0 and not the correct value. I have a source script that connects to the vc and calls the below in part. param($cluster) $clus =Get-cluster $cluster $start = (Get-Date).Adddays(-1) $vmnewcount = ($clus | Get-VIEvent -Start $start -MaxSamples ([int]::MaxValue) | where {@("VMCreatedEvent") -contains $_.GetType().Name} | measure-object).Count $vmdelcount = ($clus | Get-VIEvent -Start $start -MaxSamples ([int]::MaxValue) | where {@("VMRemovedEvent") -contains $_.GetType().Name} | measure-object).Count New-Object PSObject | Add-Member -pass NoteProperty "VMsCreaed"           $vmnewcount   | Add-Member -pass NoteProperty "VMsDeleted"           $vmdelcount   Result: VMsCreaed  : 0 VMsDeleted : 0 A second pair of eyes will be appreciated to see what i'm missing here. Thanks
Hi Luc Yes, use a source script that list all connections, this in turn calls the script in this thread and create one export per vc and name the file uniquely as per the vc's name. Johan
Hi Luc Based on the below script, if i wish to execute it for 10 different virtual centers and change the export file name based on the current connected virtual center, is there a variable th... See more...
Hi Luc Based on the below script, if i wish to execute it for 10 different virtual centers and change the export file name based on the current connected virtual center, is there a variable that i can use to define the export-csv file name? Thanks Johan
Luc Thank you very much, this worked perfectly. I'll give the "Get-View" a go, seen the latest list of article seems very impressive and just what i'm looking for.
Hi all I need some insight into the following. I have an existing script that evolved over time (original source WoodITWork.com - It's about time I let the world know what I was thinking...). ... See more...
Hi all I need some insight into the following. I have an existing script that evolved over time (original source WoodITWork.com - It's about time I let the world know what I was thinking...). The intention is to connect to 10 virtual centers, export a list of vm properties from each vc to 10 different csv files. What i need to add is the vm UUID and DNS name and then assistance with how to name each csv per the virtual center name if possible. $VC = Connect-VIServer $VCServerName #$VMFolder = "Workstations" $ExportFilePath = "C:\PS\Export-VMInfo.csv" $Report = @() #$VMs = Get-Folder $VMFolder | Get-VM $VMs = Get-VM $Datastores = Get-Datastore | select Name, Id $VMHosts = Get-VMHost | select Name, Parent ForEach ($VM in $VMs) {       $VMView = $VM | Get-View       $VMInfo = {} | Select VMName,Powerstate,OS,IPAddress,Cluster,Datastore,NumCPU,MemMb,DiskGb, DiskFree, DiskUsed       $VMInfo.VMName = $vm.name       $VMInfo.Powerstate = $vm.Powerstate       $VMInfo.OS = $vm.Guest.OSFullName       $VMInfo.IPAddress = $vm.Guest.IPAddress[0]       $VMInfo.Cluster = $vm.host.Parent.Name       $VMInfo.Datastore = ($Datastores | where {$_.ID -match (($vmview.Datastore | Select -First 1) | Select Value).Value} | Select Name).Name       $VMInfo.NumCPU = $vm.NumCPU       $VMInfo.MemMb = [Math]::Round(($vm.MemoryMB),2)       $VMInfo.DiskGb = [Math]::Round((($vm.HardDisks | Measure-Object -Property CapacityKB -Sum).Sum * 1KB / 1GB),2)       $VMInfo.DiskFree = [Math]::Round((($vm.Guest.Disks | Measure-Object -Property FreeSpace -Sum).Sum / 1GB),2)       $VMInfo.DiskUsed = $VMInfo.DiskGb - $VMInfo.DiskFree       $Report += $VMInfo } $Report = $Report | Sort-Object VMName IF ($Report -ne "") { $report | Export-Csv $ExportFilePath -NoTypeInformation } The other question is if it's still the most efficient way of useing the syntax getting the data as 4 of the vc's has got 4000+ vm's
Morning Luc Thanks for the work on this script. I've tried using it but end up with no driver Version Info.The script provide no errors to work with as to why it's missing. I'm using Power... See more...
Morning Luc Thanks for the work on this script. I've tried using it but end up with no driver Version Info.The script provide no errors to work with as to why it's missing. I'm using PowerCli 6 on vSphere 5.5 U2 Fnicvendor   : {Emulex Corporation, Emulex Corporation} fnicdriver   : enicdriver   : Enicvendor   : Emulex Could you please guide me as to where to start looking for the missing piece. Done so far: $esxcli = Get-EsxCli -VMhost "hostname" Unable to list the details as a whole to see the syntax of the version. I might be misunderstanding as to how the query construct works. Thanks Johan
Hi Luc I found most of the information I was after with the below commands. I think the only problem i'll have is that vCAC/vRA doesn't actually register with VC so that might have to be a sep... See more...
Hi Luc I found most of the information I was after with the below commands. I think the only problem i'll have is that vCAC/vRA doesn't actually register with VC so that might have to be a separate check, but for the rest it should work. $ExtensionManager = Get-View ExtensionManager $ExtensionManager.ExtensionList | Select-Object @{Name='Description';Expression={$_.Description.Label}},Key,Company,Version | Sort-Object Description Not all the versions is detailed or complete but i can work with it. Thank you for looking at this. Johan
Hi Luc I did yes, but licensing doesn't seem to have any knowlage of the detailed product version installed at the current point in time and that is the main detail i'm after. In the Webcli... See more...
Hi Luc I did yes, but licensing doesn't seem to have any knowlage of the detailed product version installed at the current point in time and that is the main detail i'm after. In the Webclient some products get listed under "Server Extensions" but again there only some gets listed and not the full detailed version. Johan
Hi Luc I'm constantly trying to evolve the attached script and need some help with line 56 & 57. I'm trying to record the number of newly created and deleted vm's per cluster. I get no er... See more...
Hi Luc I'm constantly trying to evolve the attached script and need some help with line 56 & 57. I'm trying to record the number of newly created and deleted vm's per cluster. I get no errors but the value is always 0. $vmnewcount = ($clus | Get-VIEvent -Start $start -MaxSamples ([int]::MaxValue) | where {"VMCreatedEvent" -contains $_.GetType().Name} | measure-object).Count $vmdelcount = ($clus | Get-VIEvent -Start $start -MaxSamples ([int]::MaxValue) | where {"VMRemovedEvent" -contains $_.GetType().Name} | measure-object).Count Any ideas as to where i'm going wrong? Johan
HI Luc Thank you for the speedy reply as always. Mm, after posting this i thought this might be easier via the API as the assumption could be that we use only appliances where possible and ... See more...
HI Luc Thank you for the speedy reply as always. Mm, after posting this i thought this might be easier via the API as the assumption could be that we use only appliances where possible and they will mostly all be registered to a vc or multiple. Example: vRA 6.x using the same SSO as VCSA with external vRO ....... So the windows will work for all installed products on that VC but not any of the other registered external components. Thanks again Johan
Hi there I have a new challenge and that is to automate site specific documentation. The question is if it's possible to run a powercli script agains 1 or more vc's per loction,  listing all ... See more...
Hi there I have a new challenge and that is to automate site specific documentation. The question is if it's possible to run a powercli script agains 1 or more vc's per loction,  listing all registered solutions with there respective product versions. IE: vCenter:     vcname     5.5.0 Build 2183111 VUM          vumserver vRO           vroname     5.5.2 Build .... SRM vRA ... ... The intention is to output the above details to exels. (the easy part) Thanks Johan
Hi there I'm working on a fairly comprehensive capacity script (i think)that reports by "cluster" and writes the results into a MS SQL database What i'm trying to do is show the count of new ... See more...
Hi there I'm working on a fairly comprehensive capacity script (i think)that reports by "cluster" and writes the results into a MS SQL database What i'm trying to do is show the count of new created vm's and count for deleted vm's by cluster. Attached is script i'm using, any recommendations will be welcomed. The current script completes without errors but it seems that the count isn't cluster based as per the rest of the items. Johan
Hi again Thank you very much, this solved the first problem for me, I'll open a new thread for the second part of the request, Johan
Hi tdpoakg First thank you for the reply, unfortunately this doesn't seem to work. Below is the query error. Add-Member : The SecondValue parameter is not necessary for a member of type "... See more...
Hi tdpoakg First thank you for the reply, unfortunately this doesn't seem to work. Below is the query error. Add-Member : The SecondValue parameter is not necessary for a member of type "NoteProperty" and should not be specified. Do not specify the SecondValue parameter when adding members of this type. At C:\scripts\Get-Cluster-Usage-Stats.ps1:61 char:1 + Add-Member -pass NoteProperty "ClusterCPUUsageAverage"          "{0:N1}" -f $sta ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : InvalidOperation: (:) [Add-Member], InvalidOperationException     + FullyQualifiedErrorId : Value2ShouldNotBeSpecified,Microsoft.PowerShell.Commands.AddMemberCommand Script Update: Add-Member -pass NoteProperty "ClusterCPUUsageAverage"          "{0:N1}" -f $stat.average    | Add-Member -pass NoteProperty "ClusterCPUUsageMax"          "{0:N1}" -f $stat.maximum    | Add-Member -pass NoteProperty "ClusterCPUUsageMin"         "{0:N1}" -f $stat.minimum    | Johan
Hi there I need some assistance in getting the correct syntax for line 61-63 in the attached script and getting the correct values for line 56-57 on a per cluster base. i wish to remove the... See more...
Hi there I need some assistance in getting the correct syntax for line 61-63 in the attached script and getting the correct values for line 56-57 on a per cluster base. i wish to remove the decimal for the results of line 61-63, i've added the (), 0 as per the other lines but i clearly  fail to understand the correct positioning in this use case. For line 56-57 i'm trying to also get the details on a per cluster base for the previous day. Hope someone got some recommendation and any other advice for improving the script. Thanks Johan
Hi Grant & Luc Thanks for a great script. I do need some help with it please. I've modified the script variables but get the following when running with PowerCLi 5.5 R2 and VC 5.5 U1c PowerCL... See more...
Hi Grant & Luc Thanks for a great script. I do need some help with it please. I've modified the script variables but get the following when running with PowerCLi 5.5 R2 and VC 5.5 U1c PowerCLI C:\PS> .\Get-Snap.ps1 Get-HardDisk : 04/09/2014 08:32:29    Get-HardDisk        System error. At C:\PS\Get-Snap.ps1:300 char:19 +             $vm | Get-HardDisk | %{ +                   ~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [Get-HardDisk], VimException     + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.GetHardDisk Get-HardDisk : 04/09/2014 08:32:38    Get-HardDisk        System error. At C:\PS\Get-Snap.ps1:300 char:19 +             $vm | Get-HardDisk | %{ +                   ~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [Get-HardDisk], VimException     + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.GetHardDisk Get-HardDisk : 04/09/2014 08:32:38    Get-HardDisk        System error. At C:\PS\Get-Snap.ps1:300 char:19 +             $vm | Get-HardDisk | %{ +                   ~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [Get-HardDisk], VimException     + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.GetHardDisk Any advise? Thanks Johan