Categories
Archive
Blogroll

Microsoft PowerShell MVP

Cozumpark Bilisim Portali
Posted in Windows Powershell, Windows Server | No Comment | 143 views | 30/01/2012 01:36

Check-PSSnapin allows you to check specific PowerShell Snapin on server.
I’m using this function in SetLinuxVM 3.0 to check SCVMM if it’s available on server.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Check Powershell Snapin
# Author: Yusuf Ozturk
# http://www.yusufozturk.info
 
function Check-PSSnapin
{
param (
    [Parameter(
        Mandatory = $true,
        HelpMessage = 'PowerShell Snapin Name. Example: Microsoft.SystemCenter.VirtualMachineManager')]
    [string]$Name
)
 
	$Success = "1";
	$CheckSnapin = Get-PSSnapin -Name $Name -EA SilentlyContinue
	if (!$CheckSnapin)
	{
		$AddSnapin = Add-PSSnapin -Name $Name -EA SilentlyContinue
		$CheckSnapin = Get-PSSnapin -Name $Name -EA SilentlyContinue
		if (!$CheckSnapin)
		{
			Write-Debug "$Name Snapin is not available."
		}
		else
		{
			Write-Debug "$Name Snapin is added."
			$Success
		}
	}
	else
	{
		Write-Debug "$Name Snapin is already loaded."
		$Success
	}
}

You can check PS Snapin like this:

Check-PSSnapin -Name "Microsoft.SystemCenter.VirtualMachineManager"

Name is mandatory, so you must give a name for that.



Posted in Windows Powershell, Windows Server | No Comment | 146 views | 30/01/2012 01:19

Check-WmiObject allows you to check Wmi provider/interface on given server.
I’m using this function in SetLinuxVM 3.0 to decide Hyper-V Manager.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Check WMI Object
# Author: Yusuf Ozturk
# http://www.yusufozturk.info
 
function Check-WmiObject
{
param (
    [Parameter(
        Mandatory = $true,
        HelpMessage = 'Wmi NameSpace. Example: root\virtualization')]
    [string]$NameSpace,
 
    [Parameter(
        Mandatory = $false,
        HelpMessage = 'Name of the Wmi Host. Example: Server01')]
    [string]$WMIHost
)
 
	$Success = "1";
	if (!$WMIHost)
	{
		$CheckWmiObject = Get-WmiObject -Computer "." -Namespace "$NameSpace" -List -EA SilentlyContinue
		if (!$CheckWmiObject)
		{
			Write-Debug "Could not contact with Wmi Provider."
		}
		else
		{
			Write-Debug "Wmi Provider is available."
			$Success
		}
	}
	else
	{
		$CheckWmiObject = Get-WmiObject -Computer "$WMIHost" -Namespace "$NameSpace" -List -EA SilentlyContinue
		if (!$CheckWmiObject)
		{
			Write-Debug "Could not contact with Wmi Provider."
		}
		else
		{
			Write-Debug "Wmi Provider is available."
			$Success
		}
	}
}

You can check Wmi Provider like this:

Check-WmiObject -NameSpace "root\virtualization"

If you want to query different wmi host:

Check-WmiObject -NameSpace "root\virtualization" -WmiHost "Server01"

NameSpace is mandatory but you don’t need to type WmiHost if you query localhost.



Posted in Linux Server, Virtual Machine Manager, Windows Server | No Comment | 299 views | 28/01/2012 21:12

You installed CentOS 6.2 on Hyper-V and you want to install Linux Integration Services v3.2.
Let’s read documentation and see if we can.

So let’s do it on CentOS server.



Posted in Virtual Machine Manager, Windows Server | No Comment | 680 views | 29/11/2011 23:11

If you have a Hyper-V cluster in a HP Server farm then you may face with low live migration performance. We realized that HP 300 series G6 and G7 servers shipping with energy saving mode. Let’s check that from HP website.

In the ProLiant 300-series G6 and G7 RBSU, the HP Power Profile defines three possible configurations of some of the power features identified earlier in this section. The HP Power Profile provides a simple mechanism for users to configure the power management options of their system based on their tolerance to power versus performance without having to individually configure each option.

There are three possible settings for the HP Power Profile: Maximum Performance; Balanced Power and Performance; and Minimum Power Usage. An additional Custom setting is simply any combination of user settings that do not match the pre-sets for the three categories listed below.

If you want to increase performance of live migration process, you need to disable c-states from BIOS. C-States has a huge impact on live migration. Since HP comes with Balanced Power and Performance mode, it also activates C6 state on BIOS. That’s reason of the issue. So changing HP Power Profile to “Maximum Performance“, you disable C-States from BIOS and get maximum performance from Live migration. As you see our servers can utilize 99% of bandwidth.

So it’s not a good thing to use “Balanced Power and Performance” on Virtualization. Get away from it :)


Posted in Hosting & IIS7, Windows Server | No Comment | 550 views | 25/10/2011 12:53

You may get this error when you try to access MySQL server on Windows.

Host ‘localhost’ is not allowed to connect to this MySQL server.
Host ’127.0.0.1′ is not allowed to connect to this MySQL server.

Solution:

1. Stop MySQL service (from services.msc)

2. Create a text file in C:\ called “init.txt”. Paste the following code and save it.

GRANT ALL PRIVILEGES ON mysql.* TO root@localhost IDENTIFIED BY 'YourPassword!' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON mysql.* TO root@127.0.0.1 IDENTIFIED BY 'YourPassword!' WITH GRANT OPTION;

3. Open command prompt (cmd)

4. Go to MySQL bin directory on cmd.

Example: C:\Program Files\MySQL\MySQL Server 5.1\bin



Posted in Windows Server | No Comment | 409 views | 03/10/2011 13:36

You may get this error when you add WMI sensor on Paessler PRTG Monitor.

Probably there is a firewall between servers or target server is behind the NAT. Solution is modifying “hosts” file of Windows.

Modify “hosts” and type like “10.10.10.10 %hostname%”. Hostname is the computername of Windows machine.



Posted in Windows Server | No Comment | 1,078 views | 24/07/2011 08:35

Daha önceki yazıda, sunucunuz üzerinde DorukCloud Online Backup servisini nasıl kurabileceğinizi anlatmıştım. Şimdi kurulum sonrası basit bir Web sitesi yedekleme kuralı girelim.

Adım 1: Yazılımı ilk kez açtığınızda karşınıza bir kayıt sihirbazı gelecektir. Bu sihirbazı “Sonraki” diyerek geçiniz.

Adım 2: DorukCloud paneli üzerinden yarattığınız yedekleme kullanıcısının bilgilerini giriniz.

Adım 3: Kriptolama için yaratmış olduğunuz şifre anahtarınızı giriniz. (Ben daha önce yarattığım için soruyor)

Adım 4: “Bitir” butonuna basarak kayıt sihirbazını bitirin.

Adım 5: “Sonraki” butonuna basarak, yedekleme sihirbazını geçin.

Adım 6: Yedekleme için bir isim ve yedekleme yerinin bilgisini girin.

Adım 7: Yedekleme yapmak istediğiniz klasör ya da klasörleri seçin.

Adım 8: Yedeğin ne sıklıkla alınması gerektiğini ve kaç gün süreyle saklanması gerektiğini belirtin.

Adım 9: Bu adımlar sonrası ana sayfaya gitmiş olacaksınız.

Adım 10: “Yedekleme” tabı altından biraz önce yarattığınız yedekleme görevini görebilir ve manual olarak başlatabilirsiniz.

Yedekleme raporları, kullanıcınızın mailbox’ına günlük olarak gönderilmektedir.
Kullanıcıya external mail adresi tanımlamayı unutmayın.