Archive

Archive for the ‘Uncategorized’ Category

PowerCLI: Configuring additional portgroups

I had to configure additional portgroups based on vlanids on a vSphere cluster. I couldn’t use host profiles to apply the configuration on all hosts.

$vCenter = Connect-VIServer -server(Read-Host "Please enter the name of your vCenter Server.")
$Cluster = Get-Cluster -Name (Read-Host "Please enter the name of the cluster whose servers need to be reconfigured.")
$vSwitch = Read-Host "Please enter the name of the vSwitch on which the portgroups need to be created."
$PGfile = import-csv -Path (Read-Host "Please enter the path to the csv file with the new portgroups to be added to the vSwitch")

$Cluster | Get-VMhost | `
Foreach{
$vSwitch = Get-VirtualSwitch -Name $vSwitch -Vmhost $_
$PGfile | `
Foreach {
$vpg = New-VirtualPortGroup -VirtualSwitch $vSwitch -Name $_.PortGroupName
Set-VirtualPortGroup -VirtualPortGroup $vpg -VLanId $_.Vlanid
}
}

Disconnect-VIserver -Server $vCenter -Confirm:$False

The script asks for

  • vCenter IP or FQDN
  • Cluster Name
  • vSwitch name
  • Path to the csv file

The csv file contains the portgroup names and vlanid’s.

PortGroupName,Vlanid
VLAN900,900
VLAN901,901
VLAN902,902

Terminal server 2008: Access denied error and eventlog not starting

On our teminal server 2008 farm we had some serious problems the last couple of days. Whenever users tried to login they got a “Access Denied” error. Only administrator accounts were able to log in. Additionally the eventlog, the McAfee services and some other services weren’t started automatically.
It was even not possible to start the eventlog manually.

We saw this issue on all our Terminal servers once they were joined to the domain. We finally nailed down the cause of these problems to be an group policy who configures the language settings.

Apparently this GPO changed also the language settings for the local system account. Which caused these services not to start anymore.

Pieter Wigleven posted already about a similar problem he had with Hyper-V and how he fixed it.

Update: Microsoft released a hotfix for this problem: KB951430.

Categories: Uncategorized