henrydenhengst

Add Target Device XenApp 65

Aug 20th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #---------------------------------------------------------------------
  2. # Script: AddTargetDeviceXenApp65.ps1
  3. # Add Target Devices
  4. # Creator: Wilco van Bragt
  5. # Creation Date: 22-08-2013
  6. #---------------------------------------------------------------------
  7. # The file that will be used need to be formatted devicename,MaCaddress per line
  8. #---------------------------------------------------------------------
  9. # Import Modules
  10. #---------------------------------
  11. add-PSSnapIn mclipssnapin
  12. #Define Variables
  13. #---------------------------------
  14. $PVSSiteValue=”VanBragtSite”
  15. $PVSCollectionValue= “VanBragtCollection”
  16. #User Defined Variables
  17. #---------------------------------
  18. $targetdevices=Read-Host "Please enter the path and name of the file containing the target devices information"
  19. #Read Target Devices and perform actions
  20. #---------------------------------
  21. $TDFile=Get-Content $targetdevices
  22. foreach ($line in $TDFile)
  23.                 {              $line = $line -split(',')
  24.                                $DeviceName = $Line[0]
  25.                                write-host "$DeviceName"
  26.                                $MAC = $Line[1]
  27.                                write-host "$MAC"
  28.                                #Add Target Devices
  29.                                Mcli-Add Device -r deviceName="$DeviceName",collectionName="$PVSCollectionValue",siteName="$PVSSiteValue",deviceMac="$MAC",copyTemplate="1"
  30.                                #Create AD Account
  31.                                Mcli-Run AddDeviceToDomain -p deviceName="$DeviceName",organizationUnit="VanBragt/Servers/XenApp65SH"
  32.                 }
Advertisement
Add Comment
Please, Sign In to add comment