Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #---------------------------------------------------------------------
- # Script: AddTargetDeviceXenApp65.ps1
- # Add Target Devices
- # Creator: Wilco van Bragt
- # Creation Date: 22-08-2013
- #---------------------------------------------------------------------
- # The file that will be used need to be formatted devicename,MaCaddress per line
- #---------------------------------------------------------------------
- # Import Modules
- #---------------------------------
- add-PSSnapIn mclipssnapin
- #Define Variables
- #---------------------------------
- $PVSSiteValue=”VanBragtSite”
- $PVSCollectionValue= “VanBragtCollection”
- #User Defined Variables
- #---------------------------------
- $targetdevices=Read-Host "Please enter the path and name of the file containing the target devices information"
- #Read Target Devices and perform actions
- #---------------------------------
- $TDFile=Get-Content $targetdevices
- foreach ($line in $TDFile)
- { $line = $line -split(',')
- $DeviceName = $Line[0]
- write-host "$DeviceName"
- $MAC = $Line[1]
- write-host "$MAC"
- #Add Target Devices
- Mcli-Add Device -r deviceName="$DeviceName",collectionName="$PVSCollectionValue",siteName="$PVSSiteValue",deviceMac="$MAC",copyTemplate="1"
- #Create AD Account
- Mcli-Run AddDeviceToDomain -p deviceName="$DeviceName",organizationUnit="VanBragt/Servers/XenApp65SH"
- }
Advertisement
Add Comment
Please, Sign In to add comment