Wednesday, February 18, 2015

PVS Automation with PowerShell

 

The script support installs when you install the Desktop Delivery Controller and PVS console.

  1. Install the Desktop Delivery Controller and PVS consoles (or the powershell MSIs)
  2. Add-PSSnapin *Citrix*,*PVS*
  3. Installing Microsoft’s Remote Server Administration Tool(RSAT) Active Directory Support
  4. Import-Module ActiveDirectory

The Provisioning Services cmdlets are installed via a 2 step process.

  1. Run the following command to install the MCLIPSSnapin for the PVS cmdlets:
  2. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Installutil.exe “C:\Program Files\Citrix\Provisioning Services Console\MCLiPSSnapin.dll”
  3. Add-PSSnapin MCLiPSSnapin

Now you have come this far some interesting commands:

Get all Devices in

Mcli-Get Device

Get devices in collection

MCLI-Get Device -p collectionName=”COLLECTIONNAME”,siteName=”SITENAME”

Add a device

MCLI-add Device –r devicename=xxxx1, deviceMac=00-xx-00-xx-00-xx, description=”something”, collectionName=”coll name”, siteName=”your site”

Get device details

MCLI-get Device –p devicename=xxxx1

Delete a device

MCLI-delete Device –p devicename=xxxx1

Add existing vDisk to store

MCLI-Add diskLocator -r diskLocatorName=”VDISKNAME”,siteName=”SITENAME”,storename=”STORENAME”

Add the target device to its device collection and create a computer object

Mcli-Add Device -r deviceName=$VM_Name, collectionName=$collection, siteName=$site_1, deviceMac=$MAC, description=$description, copyTemplate=1
Mcli-Run AddDeviceToDomain -p deviceName=$VM_Name, organizationUnit=$OU

No comments:

Blog Archive