Yearly Archives: 2013

Exchange: Get a list of all email address

For en liste over alle mail adresse

Get-recipient -resultsize unlimited | select name -expand emailaddresses | select name,smtpaddress

For en liste over alle mail adresse på et given domæne

Get-Recipient | Where{$_.EmailAddresses -match "it-grp.dk"} | select name -expand emailaddresses | select name,smtpaddress | where {$_ -match "kennethdalbjerg.dk"}

Dual boot Ubuntu and Windows 7, with Safeboot / Mcafee Endpoint Encryption

First you need to install Windows 7, and safeboot / Mcafee endpoint protection.

Then you need to take a backup of the MBR, this is done with a Ubuntu live cd, run this commands:

dd if=/dev/sda of=/path/safeboot.mbr bs=512 count=1

 

Put it on a USB flash drive or something else, that you can access after the installation.

After you have make a backup of the MBR, just install Ubuntu the normally way, after you have make changes to grub2 config files.

cp /path/safeboot.mbr /boot/
nano /etc/grub.d/40_custom

At the buttom of this files you need to insert this:

menuentry "Windows 7" {
set root='hd0,msdos1'
chainloader (hd0,msdos5)/boot/safeboot.mbr
boot
}

Where set root=’hd0,msdos1′ is becuase my windows 7 root partition is locate on disk 0, and msdos partition 1, and chainloader (hd0,msdos5)/boot/safeboot.mbr is because my ubuntu partition is located on disk 0 and msdos partition 5.

Upgrade firmware on Dellservers running XenServer and get Dell Openmanage aswell

First you need to enable some standard Repos first

vi /etc/yum.repos.d/CentOS-Base.repo

Enable base and updates.

Then you need to enable Dell yum Repos

wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash

This will automatically create the repo files in /etc/yum.repos.d
Next we will install Dell OMSA (Openmanage) and the firmwall tools needing to upgrade firmware on a Dell Server.

yum install srvadmin-all firmware-tools

 

Then we have to start the Dell Openmanage software this can be done with

/opt/dell/srvadmin/sbin/srvadmin-services.sh start

And after this we can run

/opt/dell/srvadmin/sbin/srvadmin-services.sh status

To check that the Dell Openmanage is running okay.
Now you just need to enable port 1311TCP in the firewall of yours Xenserver

nano /etc/sysconfig/iptables

Now add the following line:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1311 -j 
ACCEPT

And restart Xenserver firewall with this commands:

service iptables restart

Now you should be able to browse to https://IPADDROfXenserver:1311 and logon with root and the root password.

If you want to enable SNMP Traps:
To make SNMP Traps working in DOM, you need to enable it:

nano /etc/snmp/snmpd.conf

insert at the buttom of the file:

trapsink IPADDR Communityname

And then restart SNMPD

service snmpd restart

To update Dell firmware tools, you can use this commands:

yum install $(bootstrap_firmware)
update_firmware --yes

This will run for some time.

Citrix XenDesktop – Desktop Popsup with connection and then closes

Today i have this problem, that my brand new setup of XenDesktop just start and showing connecting, but just after a few seconds just drop the connection, and the VDI is restarting.

So I push the connect buttom and when it shows connecting, i put the machine in maintaince mode, so it is not restarting automatic.

Then look at the Event Viewer, and it was showing this error:
Source: Citrix ICA Service
Event ID: 1260
Type: Warning
Description: ICA connection is cancelled because auto-logon is enforced and auto-logon failed.
For more information, see
http://support.citrix.com/proddocs/topic/online-plugin-121-windows/ica-sson-enable.html.

When look at the support.citrix.com page I got a 404 error page.

Search the Internet and found at that my user account dosent was permitted to logon locally, enable this though Group Policy
Group Policy here: Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment -> Allow log on locally

By default the following users and groups are granted to log on locally on windows 7:
Guest
Administrators
Users
Backup Operatiors

XenServer: Powershell

If you like Powershell, you will like the XenServer Powershell.

Download XenServer SDK from the Citrix.com download page (You need to logon with you Citrix credentitals)

After you have install Citrix Xenserver Powershell, you can test to see if it have been install by running this comands:

Get-PSSnapin -registered

If it installed, you can add it to you powershell session by typing this command:

Add-PSSnapin Xen*

To connect to the XenServer

Connect-XenServer -Url https://<ServerIP>

To get all vm on the Xenserver:

Get-XenServer:VM

To only show the VM with VDI in the middle of the name

Get-XenServer:VM -name *vdi*

To see all command from XenServer Powershell

Get-Command -module Xen*

 

See more commands here:

http://kennethdalbjerg.dk/wp-content/uploads/2013/05/Citrix_XenServer_6.0_CmdLet_Poster.pdf
http://www.qa.com/about-qa/blogs/2012/july/citrix-xenserver-6-and-powershell/

XenServer: Add an extra Core to a CPU Socket

You can’t add extra Core to a CPU socket though XenCenter, you need to start you console of the XenServer.

To Add 4 Core in each CPU Socket you need to run this commands:

xe vm-param-set platform:cores-per-socket=4 uuid=<VM UUID>

To found the vm’s UUID, you can use these commands:

xe vm-list name-label=<Name of the VM>

After you have put 4 core in each CPU socket you also need to run these commands:

xe vm-param-set VCPUs-max=8 uuid=<VM UUID>
xe vm-param-set VCPUs-at-startup=8 uuid=<VM UUID>

This will add 8 CPU in totalt, but only 2 CPU socket with each 4 Core.

Kubuntu – Blankpage / hang after logon

Today I have a problem with my Kubuntu, that after i have apply my password for my user, I just got a blank page, only with the standard background of Kubuntu.

I found that I couldn’t start KDE, with the command startkde in the console, I don’t know how, but i was missing the apt-get packet name “kde-workspace-bin”

So I run this command:

sudo apt-get install kde-workspace-bin

Tips:  You can get into the console but holding down the following keys: CTRL ALT F1