how to convert your Powershell output to HTML file

Powershell has ability to save a html file for your scripts output.This gives you more flexibility to read and modify data format.

example 1

get-process | convertTo-html | set-content c:\Get-process.htm

This command gives your get-process command output to c:\get-process.htm
______________________

example 2

get-process | convertto-html -title "Get-process for this machine" -body "You can see processes of this machine" | set-content c:\get-processWithbody.htm

We add a title text and a body text to our html.





you can change the format of the html page.
-body "

"
-body " "


http://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/convertto-html.mspx

Ping a host address by using Powershell

#create a ping object

$ping=New-Object net.NetworkInformation.Ping

#we gonna ping 4 times.

for ($i=0;$i -lt 4;$i++)
{
$result=$ping.send("www.google.com")
#if clause will decide whether it is ok or not.

if ($result.status -eq "Success")
{
$result.Address.ToString() + " IP address has been responding."
$result.Status
}
else{
"Failed"
}
}

Powershell-Creating Local User

how to create a local user by using Powershell

$user="powershell"
$password="12345678"

#uses ADSI types and WinNT provider

$objou=[ADSI]"WinNT://erkan_sezgin"
$objuser=$objou.create("user",$user)
$objuser.setpassword($password)
$objuser.setinfo()
$objuser.description="test user"
$objuser.setinfo()

Powershell Net formları giriş

[void][reflection.assembly]::LoadWithPartialName(
"System.windows.forms"
$form=new-object windows.forms.form
$form.text="Form Başlık"
$button=new-object windows.forms.button
$button.text="Click"
$button.dock="Fill"
$button.add_click({$form.close()})
$form.controls.add($button)
$form.add_shown({$form.activate()})
$form.showdialog()

motosikletim


Hyosung Comet 250 ,naked motosikletim.250 cc olmasına rağmen 29 beygir.benim gibi bir acemiye göre çok iyi bir motor.

Physical to Virtual Free Process

Eğer fiziksel bir makinayı sanallaştırma ihtiyacınız varsa bunun için bir kaç tane araç bulabilirsiniz.BARTPE,vmware P2V assistant,platespin powerp2v gibi.
burda bahsedeceğimiz olay tamamen bedava bir sanallaştırma olayı.Yanlış anlaşılma olmasın,virtual server'ınızın lisans ücretinden değil tamamen işlemin bedelinden bahsediyoruz.

-Cat your hard drive.
p-to-v işlemleri aslında genel olarak basittir.fiziksel bir sürücünün kopyasını alarak sanal sunucu üzerine göndermek demektir.
bahsedeceğimiz metod blok blok tüm sürücünün kopyasını bir dosya ve cat komutuyla ara katmanda bulunan bir sunucuya gönderecek.Bu sunucudan sonra ise sanal sunucuya aktarım yapılacak.

physical server--->Ara katman sunucu--->Hedef sanal sunucu

neye ihtiyacınız var.

-NFS mount edilebilen ara katman sunucu.(windows services for unix servisinin çalıştığı bir windows şahane olur.)
-redhat 9 disk 1

fiziksel sunucuyu redhat cd si ile açıyoruz.açılış sırasında "linux rescue " yazıyoruz.Network için no yu seçin.

ifconfig eth0 up
ifconfig eth0 192.168.1.99

network ün çalıştığından emin olun gateway i felan pingleyin.
NFS servisi çalışan makinayı pinglediğinizden emin olun.

daha sonra,
cd /tmp
mkdir XXX
mount -t nfs 192.168.1.100/share ./XXX
cd XXX

komutlarını verin.


hangi partitionları sanal hale getireceğiz ona bakalım.
df -h komutu belki işinize yarayabilir.
ilk sürücü olarak /dev/sda ikinci sürücü olarak /dev/sdb ile çalışacağımızı farzedelim.

fdisk -l /dev/sda
fdisk -l /dev/sda > fda

cat /dev/sda ../split -b1024m - sda_ &


bu sayede ilk diski ara katman sunucuya aktarmış olduk.

sanal sunucuyu redhat cd si ve ilk yöntemle açın.
network ayarlarını aynı şekilde ayarlıyoruz.

cd /tmp
mkdir XX
mount -t nfs 192.168.1.100:/share ./XX
cd XX

komutumuz fdisk -l /dev/sda
cat sda_* >/dev/sda

sanal makina işlem bittikten sonra boot edilmeye hazırdır.


Erkan SEZGIN

Ser ve Estar

Ser ve Estar ingilizcede "to be" olarak çevrilebilir.

I am,you are,he/she is vs vs.

Ser ve Estar konuşmada belirtilen nesnenin "condition" ya da "essence" ifade edeceğine göre değişir.

She is quiet-->Ella es callada

She is being quite-->Ella esta callada.

que pasa

İspanyolca öğreniyoruz.