SCharchouf's Posts

Best option is to get a LOG regarding what was implemented in case of any issue we can trace
Thank you LucD I was inspired by your idea, I just have a problem I can't create a LOG file Below the Script : Connect-VIServer -Server X.X.X.X $VMS = Get-Content C:PATH\List_VMs.txt f... See more...
Thank you LucD I was inspired by your idea, I just have a problem I can't create a LOG file Below the Script : Connect-VIServer -Server X.X.X.X $VMS = Get-Content C:PATH\List_VMs.txt foreach ($vm in $VMS){     New-advancedsetting -Entity $vm -Name isolation.device.connectable.disable -value $true -force -Confirm:$false     New-advancedsetting -Entity $vm -Name isolation.device.edit.disable -value $true -force -Confirm:$false     New-advancedsetting -Entity $vm -Name isolation.tools.copy.disable -value $true -force -Confirm:$false } Disconnect-VIserver -Confirm:$false
apologies, my bad,  mean that I need to update advanced settings for VMs in a specific cluster sorry
No error received and I have about 10 settings to implement for specif clusters on the first step: "isolation.device.connectable.disable" -value $true "isolation.device.edit.disable" -value $... See more...
No error received and I have about 10 settings to implement for specif clusters on the first step: "isolation.device.connectable.disable" -value $true "isolation.device.edit.disable" -value $true "isolation.tools.copy.disable" -value $true "isolation.tools.diskShrink.disable" -value $true "isolation.tools.diskWiper.disable" -value $true "isolation.tools.dnd.disable" -value $true "isolation.tools.paste.disable" -value $true "isolation.tools.setGUIOptions.enable" -value $false "log.keepOld" -value "10" "log.rotateSize" -value "1024000"
PowerCLI Version ----------------    VMware vSphere PowerCLI 6.3 Release 1 build 3737840 --------------- Component Versions ---------------    VMware Cloud Infrastructure Suite PowerCLI Com... See more...
PowerCLI Version ----------------    VMware vSphere PowerCLI 6.3 Release 1 build 3737840 --------------- Component Versions ---------------    VMware Cloud Infrastructure Suite PowerCLI Component 6.3 build 3709081    VMWare AutoDeploy PowerCLI Component 6.0 build 3736841    VMWare ImageBuilder PowerCLI Component 6.0 build 3736841    VMware vSphere PowerCLI Component 6.3 build 3709081    VMware VDS PowerCLI Component 6.3 build 3709081    VMware vCloud Director PowerCLI Component 6.3 build 3615264    VMware HA PowerCLI Component 6.0 build 3625284    VMware License PowerCLI Component 6.0 build 3615733    VMware vCloud Air PowerCLI Component 6.3 build 3615264    VMware PowerCLI Component for Storage Management 6.0 build 3617867    VMware vROps PowerCLI Component 6.3 build 3615304    VMware vSphere Update Manager PowerCLI 6.1 build 3607502 I'm trying to change advanced settings for a specific Cluster using the below command, unfortunately nothing changed: Get-AdvancedSetting -Entity (Get-Cluster -Name Cluster) -Name SettingName | Set-AdvancedSetting -Value NewValue Could you please assist on this
Thank you LucD
I created the below script, unfortunaly with some errors [sorry as I'm not yet expert] I'm able to see information on PowerCLI but on the report only one VM is reported # vCenter Login     ... See more...
I created the below script, unfortunaly with some errors [sorry as I'm not yet expert] I'm able to see information on PowerCLI but on the report only one VM is reported # vCenter Login         $vCUser="domain\uset"     $vCPass="user" # LIST OF vCenter         $vCenterIP = "X.X.X.X" # Connection to vCenter     foreach ($IPAddress in $vCenterIP){         Connect-VIServer $IPAddress -User $vCUser -Password $vCPass -port 443 } #Variables $Date = Get-Date $Datefile = ( Get-Date ).ToString("yyyy-MM-dd-hhmmss") $ErrorActionPreference = "SilentlyContinue" # Variable to change     $CreateCSV= "yes"     $GridView = "no"     $FileCSV = New-Item -Type File -Path "C:\Report\CheckDisks_VMs_$datefile.csv"     Write-Host "Gathering VM Disks Info" $report = @()                 Get-VM | ForEach-Object {               $VM = $_               $_.Guest.Disks | ForEach-Object {                 $Report = "" | Select-Object -Property VM,Path,Capacity,FreeSpace,PercentageFreeSpace                 $Report.VM = $VM.Name                 $Report.Path = $_.Path                 $Report.Capacity = $_.Capacity                 $Report.FreeSpace = $_.FreeSpace                 if ($_.Capacity) {$Report.PercentageFreeSpace = [math]::Round(100*($_.FreeSpace/$_.Capacity))}                 $Report   } } #Output if ($GridView -eq "yes") {     $report | Out-GridView } if ($CreateCSV -eq "yes") {     $report | Export-Csv -LiteralPath $FileCSV -UseCulture -NoTypeInformation } #Disconnect session from VC     Disconnect-VIserver -Confirm:$false
It's Ok when I open the CSV using Notepad++ or if I open it directly in excel but if I import it it add the line it's fine and thank you for your help stay safe
Interesting, I guess the issue is with Excel file when I import it
#Initialize PowerCLI #add-pssnapin VMware.VimAutomation.Core # vCenter Login $vCUser="domaine\user" $vCPass="password" # LIST OF vCenter $vCenterIP = "X.X.X.X" foreach ($IPAddress in... See more...
#Initialize PowerCLI #add-pssnapin VMware.VimAutomation.Core # vCenter Login $vCUser="domaine\user" $vCPass="password" # LIST OF vCenter $vCenterIP = "X.X.X.X" foreach ($IPAddress in $vCenterIP){     # Connection to vCenter     Connect-VIServer $IPAddress -User $vCUser -Password $vCPass -port 443 } #Variables $Date = Get-Date $Datefile = ( Get-Date ).ToString("yyyy-MM-dd-hhmmss") $ErrorActionPreference = "SilentlyContinue" # Variable to change $CreateCSV= "yes" $GridView = "no" $FileCSV = New-Item -Type File -Path "C:\Users\S852547ADM\Desktop\PowerShell_Script\Report\AdvancedSettings_VMs_$datefile.csv" Write-Host "Gathering VM settings" $report = Get-VM -PipelineVariable vm | Get-AdvancedSetting | Select @{N='VM';E={$vm.Name}},@{N='vCenter';E={([uri]$vm.ExtensionData.Client.ServiceUrl).Host}},Name, Value #Output if ($GridView -eq "yes") {     $report | Out-GridView } if ($CreateCSV -eq "yes") {     $report | Export-Csv -LiteralPath $FileCSV -UseCulture -NoTypeInformation } #Disconnect session from VC Disconnect-VIserver -Confirm:$false
Thanks LucD, it's much better now but the first line still show Column 1... I'm checking the reason why it show this details
Yes I'm sure That I have copied the script you shared. Now the vce is added and I attached the output
Also I would like to have the vCenter IP or name on the report in order to be able to trace everything
Thank you it's working just the CSV obtained when I open it in Excel the first line containe : Column1, Column2, Column3 and the second line contain VM, Name, Value is there any way to de... See more...
Thank you it's working just the CSV obtained when I open it in Excel the first line containe : Column1, Column2, Column3 and the second line contain VM, Name, Value is there any way to delete the first line?
I have a big list of VMs and they are on different Hosts and managed by differentes vCenter. I'm trying to create a script in order to get all Advanced Settings in order to correct them based on... See more...
I have a big list of VMs and they are on different Hosts and managed by differentes vCenter. I'm trying to create a script in order to get all Advanced Settings in order to correct them based on audit report. I'm using the below script and it return 0 details: # vCenter Login $vCUser="domain\user" $vCPass="PASSWORD" # LIST OF vCenter $vCenterIP = "X.X.X.X" foreach ($IPAddress in $vCenterIP){     # Connection to vCenter     Connect-VIServer $IPAddress -User $vCUser -Password $vCPass -port 443 } #Variables $Date = get-date $Datefile = ( get-date ).ToString("yyyy-MM-dd-hhmmss") $ErrorActionPreference = "SilentlyContinue" # Variable to change $CreateCSV= "yes" $GridView = "no" $FileCSV = New-Item -type file "C:\Report\VMWARE_REPORT_$datefile.csv" $output += ‘<H1>[2017 - Report Monthly Virtual Machine</H1>’ $output += ‘<H2>Date and time</H2>’,$date Write-Host "Gathering VM statistics" $report = @() foreach($vm in Get-View -ViewType Virtualmachine){ Get-VM $server| Get-AdvancedSetting | Select Name, Value } #Output if ($GridView -eq "yes") { $report | Out-GridView } if ($CreateCSV -eq "yes") { $report | Export-Csv $FileCSV -NoTypeInformation } #file CSV $filename = "C:\Report\VMWARE_REPORT_$datefile.csv" #Disconnect session from VC Disconnect-VIserver -Confirm:$false
it's Ok now and I'm able to connect to 2 vCenter but regarding $global:defaultviservers I don't have this variable in the script that I'm using. I'm using the script that I find here Report... See more...
it's Ok now and I'm able to connect to 2 vCenter but regarding $global:defaultviservers I don't have this variable in the script that I'm using. I'm using the script that I find here Report_VirtualMachine.ps1
Thank you LucD
Would you please help me to understand how we can connect to different vcenter using PowerShell script? I started with this lines, unfortunately each time I add a vcenter to this script it xonne... See more...
Would you please help me to understand how we can connect to different vcenter using PowerShell script? I started with this lines, unfortunately each time I add a vcenter to this script it xonnect to last one on the list:   #Initialize PowerCLI add-pssnapin VMware.VimAutomation.Core # vCenter Login $vCUser="domain\user" $vCPass="Password" # LIST OF vCenters $vCenterIP = "x.x.x.x" $vCenterIP = "x.x.x.x" foreach ($IPAddress in $vCenterIP){     # Connessione a vCenter     Connect-VIServer $IPAddress -User $vCUser -Password $vCPass -port 443 }
Hi All can you help me with some advice on how we can identify user IP connected to ESXi via SSH Thanking you in advance.