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

Badges
MCSE
Community

Cozumpark Bilisim Portali
Posted in Windows Powershell | 1 Comment | 3,490 views | 23/04/2013 16:55

Hello,

PoSHStats for Exchange Server v2.2 is almost ready!
I’m releasing latest version for tests. Please let me know if you find any bugs etc.

Main Screenshot:

poshstats-for-exchange

Example of Exchange Host Reporting:

host

Example of Mailbox Database Reporting:

db_reports

Example of User Mailbox Reporting:

mailbox

It has a nice limit information bar :)

limit

Also you can see service status of Exchange hosts:

services

This is not the final version of PoSHStats.
There will be more features for Exchange but I think this version is enough for many enterprises.

Tested with 3000 mailboxes, everything seems ok. First time setup will take about 5-10 minutes depends on your environment.

First download setup:

Install setup.exe. After installation, open PowerShell and:

1
2
Import-Module PoSHStats
Start-PoSHStats

Give your hostname (like reports.poshstats.net or 192.168.2.1) and port number, then you are free to go.

Thanks for using PoSHStats.

Yusuf.


Posted in Windows Server | 1 Comment | 3,925 views | 14/04/2013 17:28

Boot into command prompt with Windows Server 2008 R2 DVD.

1
2
3
4
D:
cd windows\system32
ren utilman.exe utilman.exe.bak
copy cmd.exe utilman.exe

Change windows password by using Utilman (Windows Key + U) on logon screen.

net user Administrator NewPassword

After that, you should revert changes.


Posted in Windows Server | No Comment | 17,659 views | 11/04/2013 15:49

You can disable “Restrict each user to a single session” on Windows Server 2008 by using “Remote Desktop Session Host Configuration”. But that tool is not available on Windows Server 2012. So we should disable it from local policy to enable 2 sessions at the same time.

Open run and type “gpedit.msc” for Local Group Policy. Go to:

Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Connections

RDP

Simply disable “Remote Desktop Services users to single remote desktop session” option.

After that you will be able to connect your server with 2 different session.


Posted in Windows Server | No Comment | 11,184 views | 10/04/2013 21:33

You may get Restricted User warning after a database restore if source database is MSSQL Server 2005.
You can remove that warning by this SQL query:

ALTER DATABASE Your_Database SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE Your_Database SET MULTI_USER
GO

After that, there will be no warning on your database.


Posted in Virtual Machine Manager, Windows Powershell | 10 Comments | 16,253 views | 04/04/2013 20:25

Hi guys and ladies! :)

Update: v1.4 is here! Thanks for your feedbacks.

Hyper-V VM Migration Script is ready! Now it’s possible to migrate your VMs from Hyper-V v2 to Hyper-V v3 with quick migration capabilities.

It supports following scenarios:

1. Standalone Hyper-V v2 Host
2. Hyper-V v2 Host in trusted domain
3. Hyper-V v2 Host in untrusted domain

Update v1.4:
1. Fixed network configuration issue on different subnets
2. Improved debugging

Update v1.3:
1. Added support for servers on different subnets

Update v1.2:
1. Linux VM migration support
2. Fixed a bug while getting vhd name
3. Advanced debugging switch (use -DebugMode)

So why it supports untrusted domains? Because you may not want to install Windows Server 2012 Cluster into your existing Windows Server 2008 R2 environment. If you have totally different environment for Hyper-V v3, then this script is your best friend.

Advantages:

1. It supports BITS! It’s ready to move large VHD files.
2. It supports “Rollback“. If there will be any problem, this script will undo any changes!!! :)
3. Licensed in GPLv2. You can use this script in your organization without any licensing issues. Totally free!

How to Install?
1. First download Hyper-V VM Migration Script:
Download Script

2. You can use exe or msi file to installation. I’ve just used migration.exe file to installation.

3. Change Powershell path if you have different drive path.

4. Click Install to begin installation.

5. That’s it! You can start using migration script.

6. Go to Powershell and type following to change execution policy as “AllSigned”.

Set-ExecutionPolicy AllSigned

7. Allow my code publishing certificate. This will prevent you to run untrusted scripts.

New-Migration

8. Installation is done! Now we can start migration of virtual machines.

How to use?

Example 1: If want to migrate VM01 from HV001 (10.10.10.2) to your local Hyper-V v3 host, use following:

New-Migration -VMName "VM01" -VMHost "HV001" -VMPath "C:\ClusterStorage\Volume1"

BTW, -VMPath switch is the destination path. Not your current VM path. This script finds VM path automatically.

Example 2: If HV001 (10.10.10.2) is a standalone machine, use following:

New-Migration -VMName "VM01" -VMHost "10.10.10.2" -Username "Administrator" -Password "123456" -VMPath "C:\ClusterStorage\Volume1"

Example 3: If HV001 (10.10.10.2) is a member of a untrusted domain, use following:

New-Migration -VMName "VM01" -VMHost "10.10.10.2" -Username "Domain\Administrator" -Password "123456" -VMPath "C:\ClusterStorage\Volume1"

Example 4: Having trouble with migration? Use debugging switch (-DebugMode) to see what really makes that problem:

New-Migration -VMName "VM01" -VMHost "10.10.10.2" -VMPath "C:\ClusterStorage\Volume1" -DebugMode

Requirements:

1. You should install this script on to your Hyper-V v3 host.

2. This script doesn’t allow you to migrate VMs if they have snapshots. You should remove them first.

3. Requires Powershell v3. (It comes by default on Windows Server 2012)

4. Hyper-V v2 host and Hyper-V v3 host should have same network switch names. If they are different, this script connects first external network to your virtual machine.

Thanks for using Hyper-V VM Migration script!

-Yusuf.


Posted in Linux Server | No Comment | 3,917 views | 01/04/2013 17:15

If you need to extend your logical volume, do following first:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
distro=$(cat /etc/issue | head -n 2 | tr -d "\n" | tr "[:upper:]" "[:lower:]")
device=$(fdisk -l | grep -w 8e | head -n 1 | cut -c-8)
partcount=$(fdisk -l | grep $device | sed 1d | grep -c $device)
newpartnum=$(($partcount+1))
startsector=$(fdisk -l | grep -w 8e | tail -1 | tr " " "\n" | sed "/^$/d" | head -n 3 | tail -1)
newstartsector=$(($startsector+1))
endsector=$(fdisk -l | grep sectors | head -n 1 | tr " " "\n" | tail -2 | head -n 1)
newendsector=$(($endsector-1))
fdisk $device <<EOF
n
p
$newpartnum
$newstartsector
$newendsector
t
$newpartnum
8e
w
EOF

Then reboot your server!

After that, you should do following to extend LVM:

1
2
3
4
5
6
7
8
9
10
11
12
device=$(fdisk -l | grep -w 8e | head -n 1 | cut -c-8)
partnumber=$(fdisk -l | grep $device | sed 1d | grep -c $device)
pvcreate $device$partnumber
volgroupname=$(vgdisplay | grep -w "VG Name" | cut -b10- | tr -d " ")
vgextend $volgroupname $device$partnumber
volgroupchars=$(echo $volgroupname | wc --chars)
totalchars=$(($volgroupchars+13))
lvmname=$(df -h | grep -w $volgroupname | head -n 1 | cut -b$totalchars-)
set $lvmname
lvmname=$1
lvextend -l +100%FREE /dev/$volgroupname/$lvmname
resize2fs /dev/$volgroupname/$lvmname

You can control final size with this command:

df -h

You should see new disk size after this process.