SlideShare a Scribd company logo
1 of 33
Jonathan Medd
What is Citrix XenDesktop?
What is Citrix XenDesktop?
How Does It Work?
XenDesktop 5 and PowerShell

 XenDesktop Management built on top of
  PowerShell
 Desktop Studio Management tool issues
  PowerShell commands behind the
  scenes
 Replaces the MFCOM scripting of
  previous versions (Same story in
  XenApp 6)
Pre-Requisites for Management
Workstation
 Install Desktop Studio on an admin
  workstation
 http://support.citrix.com/article/CTX1275
  27
Consists of….PSSnapins and Providers
Consists of….PSSnapins and Providers
 Total of 330 Cmdlets across all
 PSSnapins




        http://support.citrix.com/static/kc/CTX1272
        54/help/index.htm
Hypervisor Connections and Hosting
Units Provider
Supports the major hypervisors:
 Citrix XenServer
 VMware vSphere
 Microsoft Hyper-V
Hypervisor Connections and Hosting
Units Provider
Hypervisor Connections and Hosting
Units Provider
Manage with standard PowerShell
cmdlets:
 Get-Childitem, Get-Item
 New-Item
 Set-Item
 Rename-Item
 Remove-Item
Hypervisor Connections and Hosting
Units Provider
Give slightly more cmdlet feel with these
functions:
 Function Get-HypervisorConnection
  {Get-ChildItem xdhyp:Connections}
 Function Get-HostingUnit {Get-Childitem
  xdhyp:HostingUnits}
Demo: Create a Hypervisor Connection
and a Hosting Unit
   $HypConn = New-Item -Path xdhyp:Connections -Name
    vCenter01 -HypervisorAddress
    http://vcenter01.sunnydale.local/sdk -UserName XenDesktop
    -Password Password01 -ConnectionType vCenter –Persist
   New-Item -Path xdhyp:HostingUnits -Name pESX02 -
    HypervisorConnectionName vCenter01 -RootPath
    XDHyp:ConnectionsvCenter01HQ.datacenterPhysical.fold
    erpesx02.sunnydale.local.computeresource -NetworkPath
    "XDHyp:ConnectionsvCenter01HQ.datacenterPhysical.fol
    derpesx02.sunnydale.local.computeresourceVM Network
    20.network" -StoragePath
    "XDHyp:ConnectionsvCenter01HQ.datacenterPhysical.fol
    derpesx02.sunnydale.local.computeresourcepESX02_Local
    .storage“
   New-BrokerHypervisorConnection -
    HypHypervisorConnectionUid
    $HypConn.HypervisorConnectionUid
Demo: Create a Hypervisor Connection
and a Hosting Unit
All actions in Desktop Studio Run
PowerShell Under the Hood
Demo: All actions in Desktop Studio Run
PowerShell Under the Hood
  • Remove Hypervisor Connection
Managing Administrators

  • New-BrokerAdministrator -BrokerAdmin $False -Enabled
    $True -FullAdmin $True -Name
    'SUNNYDALEXenDesktopAdmins' -ProvisioningAdmin
    $False -ReadOnly $False -AdminAddress
    'DDC01.sunnydale.local:80‘
  • Set-BrokerAdministrator -Name
    'SUNNYDALEXenDesktopAdmins' -BrokerAdmin $False
    -Enabled $False -FullAdmin $True -ProvisioningAdmin
    $False -ReadOnly $False -AdminAddress
    'DDC01.sunnydale.local:80'
Demo: Managing Administrators
Create a Catalog
$CatalogName = "Windows 7 Catalog“                 #Name of the catalog that will be created
$CatalogDescription = "Windows 7 MCS Catalog"      #Description given to the catalog
$DeviceNamingScheme = "Win7-#"                     #Naming scheme for the MCS-created VMs
$DeviceNamingSchemeType = "Numeric"                #Naming scheme type for the MCS-created VMs
$DeviceOU = "OU=Workstations,DC=sunnydale,DC=local" #Active Directory OU where the MCS-created VMs will be placed
$DeviceDomain = "sunnydale.local"                  #Active Directory Domain where the MCS-created VMs will be managed
$MasterVMName = "Win7Image"                        #Name of the "Master VM" that will be used with MCS
$NumDeviceAccounts = 1                             #Create 1 VM with MCS using the naming scheme defined above
$DeviceStartIndex = 1                              #VM names should start with an index of 1
$VMCpuCount = 1                                    #Two vcpu's for each MCS-created VM
$VMMemoryMB = 1024                                 #1GB ram for each MCS-created VM
$HostUnitName = "pESX02"                           #vSphere "host" as listed in the Hosts node of the Desktop Studio Console
$DDCAddress = “DDC01.sunnydale.local:80"           #DDC the cmdlets will connect to




          http://blogs.citrix.com/2011/03/24/xendesktop-5-
          powershell-sdk-primer-part-3-creating-pooled-
          catalogs-that-leverage-machine-creation-services/
Create a Catalog
  During Catalog creation you will see the below in Desktop
  Studio until Catalog has been created
Create a Catalog
#Create the catalog container
$Catalog = New-BrokerCatalog -AllocationType 'Random' -CatalogKind
'SingleImage' -Name $CatalogName -Description $CatalogDescription -PvsForVM
@() -AdminAddress $DDCAddress
#Create an identity pool to store the AD computer account info for this catalog.
#We are giving the identity pool the same name as the catalog to keep better track
$IdentityPool = New-AcctIdentityPool -IdentityPoolName $CatalogName -
NamingScheme $DeviceNamingScheme -NamingSchemeType
$DeviceNamingSchemeType -OU $DeviceOU -Domain $DeviceDomain -
AllowUnicode -AdminAddress $DDCAddress
$IdentityPool
Create a Catalog
#Get reference to the broker service group
$BrokerServiceGroup = Get-ConfigServiceGroup -ServiceType "Broker" -
AdminAddress $DDCAddress
$BrokerServiceGroup

#Add metadata to the broker service group to tie the catalog with the identity pool it
is using
$MetadataPropertyName =
"Citrix_DesktopStudio_BrokerCatalogIdentityPoolReferencePrefix_" + $Catalog.Uid
$MetadataPropertyValue = $IdentityPool.IdentityPoolUid


$NewMetadata = Add-ConfigServiceGroupMetadata -ServiceGroupUid
$BrokerServiceGroup.ServiceGroupUid -Property $MetadataPropertyName -Value
$MetadataPropertyValue -AdminAddress $DDCAddress
Create a Catalog
#Get reference to the hosting unit and hypervisor connection it uses
$HostUnitPath = 'xdhyp:hostingunits' + $HostUnitName
$HostUnit = Get-Item -Path $HostUnitPath

$HypConnection = Get-BrokerHypervisorConnection -Name
$HostUnit.HypervisorConnection.HypervisorConnectionName -AdminAddress
$DDCAddress
Create a Catalog
#Create a snapshot of the master VM image
$SnapshotName = "Citrix_XD_" + $CatalogName
$MasterVMPath = "XDHyp:hostingunits" + $HostUnit.HostingUnitName + "" +
$MasterVMName + ".vm"
$Snapshot = New-HypVMSnapshot -SnapshotName $SnapshotName -LiteralPath
$MasterVMPath -AdminAddress $DDCAddress
Create a Catalog
#Create a provisioning scheme that defines the details of the MCS cloned VMs.
#This process creates a copy of the snapshot and can take several minutes to
complete.
#Note: New-ProvScheme returns a GUID that represents the TaskID for the copy
task.
$ProvSchemeName = $CatalogName + "_" + $HostUnit.HostingUnitName
$SnapshotPath = $MasterVMPath + "" + $SnapshotName + ".snapshot“

$ProvSchemeTask = New-ProvScheme -ProvisioningSchemeName
$ProvSchemeName -HostingUnitName $HostUnit.HostingUnitName -
IdentityPoolName $IdentityPool.IdentityPoolName -VMCpuCount $VMCpuCount -
VMMemoryMB $VMMemoryMB -CleanOnBoot -MasterImageVM $SnapshotPath -
RunAsynchronously -AdminAddress $DDCAddress
Nearly there!
Create a Catalog
#Update the catalog with what provisioning scheme and hosting unit it is using
$ProvScheme = Get-ProvScheme -ProvisioningSchemeName $ProvSchemeName -
AdminAddress $DDCAddress
$PvsForVM = $ProvScheme.ProvisioningSchemeUid.ToString() + ":" +
$ProvScheme.HostingUnitUid.ToString()
Set-BrokerCatalog -Name $strCatalogName -PvsForVM $strPvsForVM -
AdminAddress $strDDCAddress
Create a Catalog
#Create machine accounts in Active Directory from info stored in the identity pool.
#After running this command, the machine accounts should be visible within the
Active Directory "Users and Computers" snap-in.
$Accounts = New-AcctADAccount -IdentityPoolName
$IdentityPool.IdentityPoolName -Count $NumDeviceAccounts -StartCount
$DeviceStartIndex -AdminAddress $DDCAddress
Create a Catalog
#Associate controllers (DDC Servers) to the provisioning scheme.
$ProvScheme = Add-ProvSchemeControllerAddress -ProvisioningSchemeName
$ProvScheme.ProvisioningSchemeName -ControllerAddress $DDCAddress -
AdminAddress $DDCAddress


#Create virtual desktop VMs from the info specified by the provisioning scheme.
After executing this command, the VMs will show up in the hypervisor.
$ProvVMTask = New-ProvVM -ProvisioningSchemeName
$ProvScheme.ProvisioningSchemeName -ADAccountName
$Accounts.SuccessfulAccounts -RunAsynchronously -AdminAddress $DDCAddress
Create a Catalog
#Loop though the newly provisioned VMs, "lock" them, and add them to the catalog
$ProvVMs = Get-ProvVM -ProvisioningSchemeName $ProvScheme.ProvisioningSchemeName
-AdminAddress $strDDCAddress
if ($ProvVMs -ne $null) {
    foreach ($ProvVM in $ProvVMs) {
           #Lock VM in the provisioning scheme with a tag called "Brokered" (so it cannot be
removed without being unlocked first)
           $LockVM = Lock-ProvVM -ProvisioningSchemeName
$ProvScheme.ProvisioningSchemeName -VMID $ProvVM.VMId -Tag "Brokered" -
AdminAddress $DDCAddress
           #Add VM to the catalog created above
           $BrokerMachine = New-BrokerMachine -CatalogUid $Catalog.Uid -HostedMachineId
$ProvVM.VMId -HypervisorConnectionUid $HypConnection.Uid -MachineName
$ProvVM.ADAccountSid -AdminAddress $DDCAddress
           if ($BrokerMachine -ne $null){
               Write-Host "Successfully added" $ProvVM.ADAccountName "to the"
$Catalog.Name "catalog..."}
           else{
               Write-Host "ERROR: Could not add" $ProvVM.ADAccountName "to the"
$Catalog.Name "catalog..."
           }
    }
}
Create a Catalog – Finished!
Bonus: Automate the DDC Install




http://www.jonathanmedd.net/2012/06/automating-the-install-of-xendesktop-ddc-with-
powershell.html
Resources

 Windows PowerShell Bible 2.0 -
  XenDesktop chapter
 Citrix Blog Series – XenDesktop 5
  PowerShell SDK Primer
     Part 1 – Getting Started
     Part 2 – Creating Hypervisor Connections
      and Hosts
     Part 3 – Creating Pooled Catalogs with MCS
     Part 4 – Creating Pool Physical Catalogs

More Related Content

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

PowerShell in XenDesktop 5

  • 2. What is Citrix XenDesktop?
  • 3. What is Citrix XenDesktop?
  • 4. How Does It Work?
  • 5. XenDesktop 5 and PowerShell  XenDesktop Management built on top of PowerShell  Desktop Studio Management tool issues PowerShell commands behind the scenes  Replaces the MFCOM scripting of previous versions (Same story in XenApp 6)
  • 6. Pre-Requisites for Management Workstation  Install Desktop Studio on an admin workstation  http://support.citrix.com/article/CTX1275 27
  • 8. Consists of….PSSnapins and Providers Total of 330 Cmdlets across all PSSnapins http://support.citrix.com/static/kc/CTX1272 54/help/index.htm
  • 9. Hypervisor Connections and Hosting Units Provider Supports the major hypervisors:  Citrix XenServer  VMware vSphere  Microsoft Hyper-V
  • 10. Hypervisor Connections and Hosting Units Provider
  • 11. Hypervisor Connections and Hosting Units Provider Manage with standard PowerShell cmdlets:  Get-Childitem, Get-Item  New-Item  Set-Item  Rename-Item  Remove-Item
  • 12. Hypervisor Connections and Hosting Units Provider Give slightly more cmdlet feel with these functions:  Function Get-HypervisorConnection {Get-ChildItem xdhyp:Connections}  Function Get-HostingUnit {Get-Childitem xdhyp:HostingUnits}
  • 13. Demo: Create a Hypervisor Connection and a Hosting Unit  $HypConn = New-Item -Path xdhyp:Connections -Name vCenter01 -HypervisorAddress http://vcenter01.sunnydale.local/sdk -UserName XenDesktop -Password Password01 -ConnectionType vCenter –Persist  New-Item -Path xdhyp:HostingUnits -Name pESX02 - HypervisorConnectionName vCenter01 -RootPath XDHyp:ConnectionsvCenter01HQ.datacenterPhysical.fold erpesx02.sunnydale.local.computeresource -NetworkPath "XDHyp:ConnectionsvCenter01HQ.datacenterPhysical.fol derpesx02.sunnydale.local.computeresourceVM Network 20.network" -StoragePath "XDHyp:ConnectionsvCenter01HQ.datacenterPhysical.fol derpesx02.sunnydale.local.computeresourcepESX02_Local .storage“  New-BrokerHypervisorConnection - HypHypervisorConnectionUid $HypConn.HypervisorConnectionUid
  • 14. Demo: Create a Hypervisor Connection and a Hosting Unit
  • 15. All actions in Desktop Studio Run PowerShell Under the Hood
  • 16. Demo: All actions in Desktop Studio Run PowerShell Under the Hood • Remove Hypervisor Connection
  • 17. Managing Administrators • New-BrokerAdministrator -BrokerAdmin $False -Enabled $True -FullAdmin $True -Name 'SUNNYDALEXenDesktopAdmins' -ProvisioningAdmin $False -ReadOnly $False -AdminAddress 'DDC01.sunnydale.local:80‘ • Set-BrokerAdministrator -Name 'SUNNYDALEXenDesktopAdmins' -BrokerAdmin $False -Enabled $False -FullAdmin $True -ProvisioningAdmin $False -ReadOnly $False -AdminAddress 'DDC01.sunnydale.local:80'
  • 19. Create a Catalog $CatalogName = "Windows 7 Catalog“ #Name of the catalog that will be created $CatalogDescription = "Windows 7 MCS Catalog" #Description given to the catalog $DeviceNamingScheme = "Win7-#" #Naming scheme for the MCS-created VMs $DeviceNamingSchemeType = "Numeric" #Naming scheme type for the MCS-created VMs $DeviceOU = "OU=Workstations,DC=sunnydale,DC=local" #Active Directory OU where the MCS-created VMs will be placed $DeviceDomain = "sunnydale.local" #Active Directory Domain where the MCS-created VMs will be managed $MasterVMName = "Win7Image" #Name of the "Master VM" that will be used with MCS $NumDeviceAccounts = 1 #Create 1 VM with MCS using the naming scheme defined above $DeviceStartIndex = 1 #VM names should start with an index of 1 $VMCpuCount = 1 #Two vcpu's for each MCS-created VM $VMMemoryMB = 1024 #1GB ram for each MCS-created VM $HostUnitName = "pESX02" #vSphere "host" as listed in the Hosts node of the Desktop Studio Console $DDCAddress = “DDC01.sunnydale.local:80" #DDC the cmdlets will connect to http://blogs.citrix.com/2011/03/24/xendesktop-5- powershell-sdk-primer-part-3-creating-pooled- catalogs-that-leverage-machine-creation-services/
  • 20. Create a Catalog During Catalog creation you will see the below in Desktop Studio until Catalog has been created
  • 21. Create a Catalog #Create the catalog container $Catalog = New-BrokerCatalog -AllocationType 'Random' -CatalogKind 'SingleImage' -Name $CatalogName -Description $CatalogDescription -PvsForVM @() -AdminAddress $DDCAddress #Create an identity pool to store the AD computer account info for this catalog. #We are giving the identity pool the same name as the catalog to keep better track $IdentityPool = New-AcctIdentityPool -IdentityPoolName $CatalogName - NamingScheme $DeviceNamingScheme -NamingSchemeType $DeviceNamingSchemeType -OU $DeviceOU -Domain $DeviceDomain - AllowUnicode -AdminAddress $DDCAddress $IdentityPool
  • 22. Create a Catalog #Get reference to the broker service group $BrokerServiceGroup = Get-ConfigServiceGroup -ServiceType "Broker" - AdminAddress $DDCAddress $BrokerServiceGroup #Add metadata to the broker service group to tie the catalog with the identity pool it is using $MetadataPropertyName = "Citrix_DesktopStudio_BrokerCatalogIdentityPoolReferencePrefix_" + $Catalog.Uid $MetadataPropertyValue = $IdentityPool.IdentityPoolUid $NewMetadata = Add-ConfigServiceGroupMetadata -ServiceGroupUid $BrokerServiceGroup.ServiceGroupUid -Property $MetadataPropertyName -Value $MetadataPropertyValue -AdminAddress $DDCAddress
  • 23. Create a Catalog #Get reference to the hosting unit and hypervisor connection it uses $HostUnitPath = 'xdhyp:hostingunits' + $HostUnitName $HostUnit = Get-Item -Path $HostUnitPath $HypConnection = Get-BrokerHypervisorConnection -Name $HostUnit.HypervisorConnection.HypervisorConnectionName -AdminAddress $DDCAddress
  • 24. Create a Catalog #Create a snapshot of the master VM image $SnapshotName = "Citrix_XD_" + $CatalogName $MasterVMPath = "XDHyp:hostingunits" + $HostUnit.HostingUnitName + "" + $MasterVMName + ".vm" $Snapshot = New-HypVMSnapshot -SnapshotName $SnapshotName -LiteralPath $MasterVMPath -AdminAddress $DDCAddress
  • 25. Create a Catalog #Create a provisioning scheme that defines the details of the MCS cloned VMs. #This process creates a copy of the snapshot and can take several minutes to complete. #Note: New-ProvScheme returns a GUID that represents the TaskID for the copy task. $ProvSchemeName = $CatalogName + "_" + $HostUnit.HostingUnitName $SnapshotPath = $MasterVMPath + "" + $SnapshotName + ".snapshot“ $ProvSchemeTask = New-ProvScheme -ProvisioningSchemeName $ProvSchemeName -HostingUnitName $HostUnit.HostingUnitName - IdentityPoolName $IdentityPool.IdentityPoolName -VMCpuCount $VMCpuCount - VMMemoryMB $VMMemoryMB -CleanOnBoot -MasterImageVM $SnapshotPath - RunAsynchronously -AdminAddress $DDCAddress
  • 27. Create a Catalog #Update the catalog with what provisioning scheme and hosting unit it is using $ProvScheme = Get-ProvScheme -ProvisioningSchemeName $ProvSchemeName - AdminAddress $DDCAddress $PvsForVM = $ProvScheme.ProvisioningSchemeUid.ToString() + ":" + $ProvScheme.HostingUnitUid.ToString() Set-BrokerCatalog -Name $strCatalogName -PvsForVM $strPvsForVM - AdminAddress $strDDCAddress
  • 28. Create a Catalog #Create machine accounts in Active Directory from info stored in the identity pool. #After running this command, the machine accounts should be visible within the Active Directory "Users and Computers" snap-in. $Accounts = New-AcctADAccount -IdentityPoolName $IdentityPool.IdentityPoolName -Count $NumDeviceAccounts -StartCount $DeviceStartIndex -AdminAddress $DDCAddress
  • 29. Create a Catalog #Associate controllers (DDC Servers) to the provisioning scheme. $ProvScheme = Add-ProvSchemeControllerAddress -ProvisioningSchemeName $ProvScheme.ProvisioningSchemeName -ControllerAddress $DDCAddress - AdminAddress $DDCAddress #Create virtual desktop VMs from the info specified by the provisioning scheme. After executing this command, the VMs will show up in the hypervisor. $ProvVMTask = New-ProvVM -ProvisioningSchemeName $ProvScheme.ProvisioningSchemeName -ADAccountName $Accounts.SuccessfulAccounts -RunAsynchronously -AdminAddress $DDCAddress
  • 30. Create a Catalog #Loop though the newly provisioned VMs, "lock" them, and add them to the catalog $ProvVMs = Get-ProvVM -ProvisioningSchemeName $ProvScheme.ProvisioningSchemeName -AdminAddress $strDDCAddress if ($ProvVMs -ne $null) { foreach ($ProvVM in $ProvVMs) { #Lock VM in the provisioning scheme with a tag called "Brokered" (so it cannot be removed without being unlocked first) $LockVM = Lock-ProvVM -ProvisioningSchemeName $ProvScheme.ProvisioningSchemeName -VMID $ProvVM.VMId -Tag "Brokered" - AdminAddress $DDCAddress #Add VM to the catalog created above $BrokerMachine = New-BrokerMachine -CatalogUid $Catalog.Uid -HostedMachineId $ProvVM.VMId -HypervisorConnectionUid $HypConnection.Uid -MachineName $ProvVM.ADAccountSid -AdminAddress $DDCAddress if ($BrokerMachine -ne $null){ Write-Host "Successfully added" $ProvVM.ADAccountName "to the" $Catalog.Name "catalog..."} else{ Write-Host "ERROR: Could not add" $ProvVM.ADAccountName "to the" $Catalog.Name "catalog..." } } }
  • 31. Create a Catalog – Finished!
  • 32. Bonus: Automate the DDC Install http://www.jonathanmedd.net/2012/06/automating-the-install-of-xendesktop-ddc-with- powershell.html
  • 33. Resources  Windows PowerShell Bible 2.0 - XenDesktop chapter  Citrix Blog Series – XenDesktop 5 PowerShell SDK Primer  Part 1 – Getting Started  Part 2 – Creating Hypervisor Connections and Hosts  Part 3 – Creating Pooled Catalogs with MCS  Part 4 – Creating Pool Physical Catalogs