Change Windows System Wide Proxy with Batch Script

Just stumbled upon a useful script that can be executed with batch script on windows to change system wide proxy setting ( IE > Internet Options > Connections > LAN Settings )

This can be useful when u have hundred computer on a domain network ( for example let say we have 300 computers ) and u need to change the proxy setting in no time yeah that would be pain in the ass if u had to manually change them one by one , u can just add it to the default startup script on the AD

To setup , open ur text editor , and here’s to enable the proxy

setlocal
set SUBKEY=Software\Microsoft\Windows\CurrentVersion\Internet Settings
reg add "HKCU\%SUBKEY%" /f /v MigrateProxy /t REG_DWORD /d 0x1
reg add "HKCU\%SUBKEY%" /f /v ProxyEnable /t REG_DWORD /d 0x1
reg add "HKCU\%SUBKEY%" /f /v ProxyServer /t REG_SZ /d "x.x.x.x:p"
reg add "HKCU\%SUBKEY%" /f /v ProxyOverride /t REG_SZ /d "<local>"
endlocal

Remember to replace x.x.x.x:p with the IP address and port of ur desirable proxy server..

And to disable

setlocal
set SUBKEY=Software\Microsoft\Windows\CurrentVersion\Internet Settings
reg delete "HKCU\%SUBKEY%\Connections" /f
reg add    "HKCU\%SUBKEY%" /f /v MigrateProxy /t REG_DWORD /d 0x1
reg add    "HKCU\%SUBKEY%" /f /v ProxyEnable /t REG_DWORD /d 0x0
reg delete "HKCU\%SUBKEY%" /f /v ProxyServer
reg delete "HKCU\%SUBKEY%" /f /v ProxyOverride
endlocal

Then , save the files as .bat

 

Tested on Windows XP & Windows 7 , but this should be work in Vista and later version of Windows too…

 

Oh yeah , previously i also write about changing proxy setting via registry script , but that method requires user intervention to do so unlike this one ūüėÄ

Advertisements

Autostart Virtual Machine on VMWare ESX

As we know earlier , if the host ( ESX ) has been turned off whether it’s properly turned off or restarted without normal procedure , when the host has been started again all the VM inside the host will not started automatically , this is the default setting by the ESX i think

So , in order to make all the VM inside the host started automatically , this can be done via vSphere client

  1. Open & login with administrative account to your vSphere client
  2. Select Configuration tab > Virtual Machine Startup / Shutdown > Properties1
  3. Make sure to check the ‘Allow virtual machines to start and stop automatically with the system’
  4. Select the VM , and choose the desirable order with move up button in the startup order to Automatic Startup group , then click OK button2
  5. The default delay for startup & shutdown for each VM is ‘120 Seconds’

 

 

 

Hope this helps..

SSH/SCP connection error: Lost connection – Double Take Availability for VMWare Infrastructure

Jadi kan skenario nya di tempat ane kerja sekarang ada 2 buah ESX yang saling replikasi menggunakan DTAVI , sebut aja ESX01 to ESX02

Nah karena kemarin ada insiden mati listrik tiba Рtiba dan UPS juga keburu out of juice , ESX02 ikutan mati juga tiba Рtiba dan ketika dinyalahkan kembali muncul error seperti ini saat booting

File_001

error log nya kira – kira seperti ini nih

File_000 (2)

udah coba beberapa cara kayak disini dan ini juga , but still no luck , ga tau juga apa mungkin ane aja yg masih meraba Рraba juga untuk step yang diberikan

Akhirnya coba re-install ESX nya , tapi dengan pilihan Preserve VMFS saat instalasi supaya VM replikasi yg sebelumnya ga ilang , oh ya arah instalasi , nama ESX dan setting network jangan lupa untuk disamakan dengan yg sebelumnya

Setelah proses instalasi kelar , pastikan semua setting kayak host name , setting network udah sama kayak sebelumnya dan langsung cek datastore nya , untuk mastiin datanya masih ada yg sebelumnya , harus nya tetep ada kalo kita Preserve VMFS saat instalasi..

Pas udah konek , data masih ada , muncul lg satu masalah pas di DTAVI nya muncul error  kayak begini pas mau mulai replikasi ,

Cannot authenticate user root

Dugaan pertama yaitu , SSH client & server nya belom dinyalahin di ESX yang baru aja di re-install , this can be done lewat configuration > security profile > properties > ceklis SSH Client & SSH Server dan jangan lupa juga karena kondisinya make user root , ubah settingan di sshd_config agar root bisa login lewat SSH 

Ga selesai sampe disitu nongol lagi error begini pas jalanin replikasi

SSH/SCP connection error: Lost connection, response from server

Solusinya masuk ke ESX01 , lalu cd ke /root/.ssh/known_hosts , hapus atau disable known host yang udah ada sebelumnya , nih contoh entry nya kayak begini nih

esx5.support.local,xxx.xxx.xxx.xxx ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAtbk3uEb6V6p5o06IyT1QU6Q6/G1bW49XyyP/lxgAmxsjNRYZTIaLzMyJshKIQSh5r0fnj36Msk5A7t0poOIHYr1ifTBye/86yfPPVZWiGdeY4rZA9H04oGCyaadObOW7h5lfYAsgqtH92gCHOcvnexLwmDGJKV9sBpYqP

Coba jalanin lagi replikasi nya and voila !

Bisa ditarik kesimpulan sotoy bahwa :

  1. SSH Client & Server harus dalam posisi enable & running pada kedua ESX yang saling replikasi
  2. Pastikan user yang kita pake di-allow untuk login lewat SSH
  3. Hapus / disable ID RSA ( security key ) ESX target pada source ESX , biar nanti bisa create ulang , karena key yang sebelumnya sudah obsolete ( kondisi ini terjadi karena kita re-install ESX target backupnya sehingga ESX source ga ngenalin key nya , padahal host & target IP nya sama persis )

 

Sekian..