@XDtipster - Two examples of simple scripts to Re-Use

10:53 PM
@XDtipster - Two examples of simple scripts to Re-Use -

Hi all,

Very short post today. Just really want to share some simple POSH scripts that I use when some of my XenDesktop training sessions. They are pretty simple, but I'm sure someone in the interweb will find useful ...

Note The examples below are for XD5.x and FMA v1 .0 but they can very easily be adapted to XD7 and FMA v2.0 by adding new services XD7 and remove the reference to the automatic service identity (PvsVmDBConnection)

Site Prep :. DB reset to $ null connection strings on all the site controllers

$ controllers = Get-BrokerController | % {$ _. DNSName}

foreach ($ controller in controllers $) {

Write-Host "Disconnect controller $ controller ..."

Set-ConfigDBConnection -DBConnection $ null -AdminAddress $ controller

Set-HypDBConnection -DBConnection $ null -AdminAddress $ controller

Set-AcctDBConnection -DBConnection $ null -AdminAddress $ controller

Set-ProvDBConnection $ -DBConnection null -AdminAddress $ controller

Set-PvsVmDBConnection -DBConnection $ null -AdminAddress $ controller

Set-BrokerDBConnection -DBConnection $ null $ -AdminAddress controller

}

SetMirrorDBConnection: Reconfigure DB connection strings all site controllers to include Failover Partner for Mirrored DB:

$ cs = 'Data Source = SQLServer; Failover Partner = SQLServer2; Initial Catalog = CitrixXenDesktopDB; Integrated Security = True; Network = dbmssocn

$ controllers = @ ( "ddc1_56", "ddc2_56")

foreach ($ controller in controllers $) {

Write-Host " reconnect controller $ controller ... "

Set-ConfigDBConnection controller -DBConnection $ cs $ -AdminAddress

Set-HypDBConnection controller -DBConnection $ cs $ -AdminAddress

Set- AcctDBConnection -DBConnection $ cs $ -AdminAddress controller

Set ProvDBConnection controller -DBConnection $ cs $ -AdminAddress

Set PvsVmDBConnection controller -DBConnection $ cs $ -AdminAddress

Set -BrokerDBConnection -DBConnection $ cs $ -AdminAddress controller

}

Best regards
Mick Glover (aka Tipster XD)
Senior Specialist preparation
Worldwide support [EMEA]
Citrix Systems, Inc.
Follow @xdtipster

Previous
Next Post »
0 Komentar