search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Posted in Windows Powershell | No Comment | 2,304 views | 27/05/2012 23:05

Yakın zaman içinde PoSH Server diye bir ürün çıkardım. PoSH Server kısaca Powershell üzerinde çalışan 30 KB’lık bir web server. Şuan için HTML, PHP ve Powershell içeriklerini http üzerinden sunabiliyor. PoSH Server, IIS’in kurulamadığı ya da daha portatif bir çözüm ile yayın yapmak istenilen sunucular için ideal bir üründür.

Kısaca PoSH Server özelliklerini maddeleyecek olursak:

1. Kimlik Doğrulama: Basic ve Windows Authentication kullanarak içeriklerinizi güvenlik altına alabilirsiniz.
2. IP Kısıtlama: HTTP yayınının bazı networkler üzerinden erişimini engelleyebilir ya da sadece belli ip adreslerinin erişimine açabilirsiniz.
3. İçerik Filtreleme: Bazı içeriklerin web sunucusu üzerinden görüntülenmesini veya indirilmesini engelleyebilirsiniz.
4. Gelişmiş Loglama: IIS standartlarında loglama sayesinde web sitenize gelen tüm istekler loglanmaktadır.
5. Log Parser: PoSH Server ile birlikte gelen ufak Log Parser sayesinde web loglarınızı görüntüleyebilirsiniz.
6. PHP desteği: WebPI üzerinden de kurabileceğiniz PHP 5.3 ve PHP 5.4’ü kullanarak, PoSH Server üzerinden PHP script çalıştırabilirsiniz.
7. Arkaplanda çalışma: Sunucunuzu restart etseniz bile PoSH Server restart sonrası çalışmaya devam edecektir.

PoSH Server, tüm bu özelliklerinin yanında; ufak boyutu, kolay kurulabilir olması ve açık kaynak kodlu olması sayesinde bir çok sistem yöneticisinin ilgisini çekebilecek bir üründür. Ayrıca Rest desteği sayesinde Powershell scriptlerinizi sunucunuzu yönetecek şekilde PoSH Server üzerinde kullanabilir ve işlem sonuçlarını XML olarak bastırabilirsiniz.

Kısa bir süre önce çıkmış olan SetLinuxVM Web Access de PoSH Server kullanarak hizmet vermektedir.

PoSH Server’ın web sitesine aşağıdaki adresten ulaşabilirsiniz.

Yine kurulum ve kullanımla ilgili sıkça sorulan soruları web sitesinde görebilirsiniz.


Posted in Windows Powershell | No Comment | 2,770 views | 22/05/2012 01:50

Well, new version of PoSH Server now supports PHP and running as a background job. But how did I do this? I’ve used scheduled jobs to start PoSH Server on every restart. Let’s see my code.

First I identify Task ID and Job Values:

1
2
3
4
5
$TaskID = Get-Random -Maximum 10000
$TaskName = "PoSHServer-$TaskHostname-$TaskPort-$TaskID"
$CreateJobIDPath = $PoSHModulePath + "\jobs\job-" + $TaskID + ".txt"
$CreateJobIDValue = $HomeDirectory + ";" + $LogDirectory + ";" + $CustomConfig + ";" + $CustomJob
$CreateJobID = Add-Content -Path $CreateJobIDPath -Value $CreateJobIDValue

Then I create scheduled job with these arguments:

1
2
3
4
5
6
7
8
9
10
$CreateTask = schtasks /create /tn "$TaskName" /xml "$PoSHModulePath\jobs\template.xml" /NP
$ChangeTaskProcess = $true
while ($ChangeTaskProcess)
{
        $ChangeTask = schtasks /change /tn "$TaskName" /tr "Powershell -Command &{Import-Module PoSHServer; Start-PoSHServer -Hostname '$Hostname' -Port '$Port' -JobID $TaskID}"
        if ($ChangeTask)
	{
		$ChangeTaskProcess = $false
	}
}

Finally, I run Scheduled Job:

$RunTask = schtasks /run /tn "$TaskName"

You can download PoSH Server v1.6 to check rest of the codes.


Posted in Windows Server | No Comment | 5,599 views | 10/05/2012 10:29

If you have multiple ip addresses on your Windows Server, Windows always use nearest ip adress to gateway. So if you need to change it, you should remove all ip addresses and add it via Netsh.

netsh interface ip add address "Local Area Connection" 10.10.10.2 255.255.255.0 skipassource=true

Skipassource means Windows won’t use this ip address for outgoing communication unless explicitly set for use by outgoing packets.


Posted in Windows Powershell | No Comment | 2,240 views | 04/05/2012 01:35

If you need to create GUID on Powershell, just you can type:

[System.Guid]::NewGuid().toString()

This command will give you something like this:

5f43a2ed-1dca-47d8-a0b8-18c7f0dbf03c

That’s all!


Posted in Virtual Machine Manager, Windows Powershell | 7 Comments | 7,165 views | 04/05/2012 01:02

I’m very proud to announce you the new version of SetLinuxVM! Today, SetLinuxVM is 1 year old!

After number of bug fixes, improvements and new functionalities, Set-LinuxVM reached to version 4.0 stable.

Fixed bugs:
1) Hyper-V LIC iso unmount issue.
2) Getting network card information issue.
3) Installation logic

New functionalities:
1) RestAPI support!
2) SetLinux Web Access: Web application for provisioning.
3) Built-in powershell web server (PoSHServer)
4) OutXML switch for XML results

General functionalities:
1) Unattended IP, Hostname and DNS configuration for Linux VMs.
2) Automatic Linux integration components installation.
3) Multi Distro Support: Debian, Ubuntu, Centos, Fedora, Redhat, Suse and CloudLinux!
4) Automatic CPanel and Parallels Plesk installation.
5) Linux VM Template support
6) Hyper-V support! You don’t need SCVMM to use this script.
7) Multiple Hyper-V and SCVMM host support.
8) Automatic Emulated NIC to Synthetic NIC support.
9) No need to internet connection (SSH access etc.) or additional changes on VM.
10) Custom Answer File support! You can execute your own scripts.
11) Hyper-V v2 and Hyper-V v3 support (fully works on Windows Server 2012 Beta)
12) System Center VMM 2008 and System Center VMM 2012 support

Screenshots:

Copyright (C) 2012 Yusuf Ozturk

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Download:

Donate: Thanks to support this open source project!





Usage:

1. First, you should allow signed Powershell scripts:

Set-ExecutionPolicy AllSigned

2. Extract file and move “SetLinuxVM” directory under to “C:\Windows\System32\WindowsPowerShell\v1.0\Modules”.

3. Import as a module:

Import-Module SetLinuxVM

4. That’s it. To see how to use it:

Get-help Set-LinuxVM -full

5. Follow to instructions.

How to start SetLinuxVM Web Access?

1. Just go to Powershell and type:

Start-SetLinuxVMWA

You can search in my blog for how to create Linux VM templates!