Home
%3CLINGO-SUB%20id%3D%22lingo-sub-375569%22%20slang%3D%22en-US%22%3EStep%20by%20Step%20instructions%20for%20installing%20RDS%20Session%20Deployment%20using%20PowerShell%20in%20Windows%20Server%202012%20R2%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-375569%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20TECHNET%20on%20Mar%2004%2C%202015%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3EHello%20AskPerf%20Readers!%20Dhiraj%20here%20from%20the%20Windows%20Performance%20team%20to%20talk%20about%20deploying%20RDS%20using%20Windows%20PowerShell%20on%20Windows%20Server%202012%20R2.%3C%2FP%3E%0A%20%20%3CP%3EAs%20you%20know%2C%20PowerShell%20has%20been%20around%20for%20quite%20a%20few%20years%20now%20(November%202006%20to%20be%20exact).%20Over%20the%20past%208%20years%2C%20we%20have%20seen%20PowerShell%20become%20an%20integral%20part%20of%20Windows.%20One%20such%20example%20is%20deploying%20RDS%20within%20your%20environment.%20In%20this%20blog%2C%20we%20are%20going%20to%20walk%20you%20through%20setting%20this%20up.%20With%20that%2C%20let%E2%80%99s%20get%20rolling!%3C%2FP%3E%0A%20%20%3CP%3EBefore%20we%20begin%20though%2C%20we%20need%20to%20import%20the%20RDS%20module%20using%20the%20%3CSTRONG%3E%20Import-Module%20%3C%2FSTRONG%3E%20cmdlet%3A%3C%2FP%3E%0A%20%20%3CP%3EImport-Module%20RemoteDesktop%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93318iC7F8BAC73E959123%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EWe%20will%20use%20the%20%3CSTRONG%3E%20New-SessionDeployment%20%3C%2FSTRONG%3E%20cmdlet%20to%20begin%20with%20the%20installation.%20Below%20is%20the%20syntax%20for%20this%20cmdlet%3A%3C%2FP%3E%0A%20%20%3CP%3ENew-SessionDeployment%20%5B-ConnectionBroker%5D%20%3CSTRING%3E%20%5B-WebAccessServer%5D%20%3CSTRING%3E%20%5B-SessionHost%5D%20%3CSTRING%3E%3C%2FSTRING%3E%3C%2FSTRING%3E%3C%2FSTRING%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CSTRONG%3ENote%20%3C%2FSTRONG%3E%20If%20you%20are%20installing%20the%20Session%20Host%20on%20the%20Connection%20Broker%2C%20then%20you%20need%20to%20run%20this%20cmdlet%20on%20a%20remote%20server%2C%20as%20running%20it%20on%20the%20connection%20Broker%20will%20give%20you%20the%20following%20error%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93319i9FF2133492846117%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EThe%20Session%20Host%20role%20needs%20a%20reboot%20after%20the%20install%2C%20and%20we%20received%20the%20above%20error%20as%20PowerShell%20cannot%20resume%20the%20deployment%20after%20a%20reboot.%20However%2C%20this%20will%20work%20in%20the%20GUI%20if%20you%20do%20the%20same%20process.%3C%2FP%3E%0A%20%20%3CP%3EIn%20this%20deployment%2C%20we%20will%20use%203%20servers%20for%20the%20deployment%3A%3C%2FP%3E%0A%20%20%3CUL%3E%0A%20%20%20%3CLI%3ERDCBWA.spike.com%20%E2%80%93%20RD%20Connection%20Broker%2C%20RD%20Web%20Access%2C%20and%20RD%20Session%20Host%3C%2FLI%3E%0A%20%20%20%3CLI%3ERDSH01.spike.com%20%E2%80%93%20Second%20RD%20Session%20Host%3C%2FLI%3E%0A%20%20%20%3CLI%3EDC01.spike.com%20%E2%80%93%20RD%20license%20server%3C%2FLI%3E%0A%20%20%3C%2FUL%3E%0A%20%20%3CP%3EWe%20will%20need%20to%20add%20RDSH01%20and%20DC01%20to%20All%20Servers%20pool%20on%20RDCBWA%20before%20we%20start%20the%20deployment.%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93320iE46CD45E6BB33384%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3ENow%20we%20run%20the%20below%20cmdlet%20on%20RDSH01%20to%20install%20RD%20Connection%20Broker%2C%20RD%20Web%20Access%20and%20RD%20Session%20Host%20on%20RDCBWA%3A%3C%2FP%3E%0A%20%20%3CP%3ENew-SessionDeployment%20%E2%80%93ConnectionBroker%20RDCBWA.spike.com%20%E2%80%93WebAccessServer%20RDCBWA.spike.com%20%E2%80%93SessionHost%20RDCBWA.spike.com%3C%2FP%3E%0A%20%20%3CP%3EDuring%20the%20install%2C%20we%E2%80%99ll%20see%20the%20following%20progress%20meters%3A%3C%2FP%3E%0A%20%20%3CP%3E1.%20Validation%20begins%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93321iB96A1F67D78D5052%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E2.%20Deployment%20begins%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93322i149A26F80F252A4D%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E3.%20Connection%20Broker%20is%20installed%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93323iEB3965CA6F44D398%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E4.%20RD%20Web%20Access%20role%20is%20installed%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93324i459787B0756CAD95%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E5.%20RD%20Session%20Host%20role%20is%20installed%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93325i621AF7DD013A57AC%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E6.%20After%20all%20roles%20are%20installed%2C%20the%20RDCBWA.spike.com%20server%20is%20restarted%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93326i32CB6FB528F3A447%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EOnce%20the%20PowerShell%20setup%20finishes%2C%20we%20now%20go%20to%20RDCBWA.spike.com%20and%20verify%20the%20installation.%20As%20you%20can%20see%20from%20the%20screenshot%20below%2C%20everything%20except%20the%20RD%20Gateway%20and%20Licensing%20server%20have%20been%20installed.%20We%20will%20now%20add%20another%20session%20host%20and%20a%20Licensing%20server.%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93327iDD2E79F5F3EB55E6%22%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93328iA4A16169E6C42F46%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EFirst%2C%20let%E2%80%99s%20add%20the%20second%20RD%20Session%20Host%20server%20to%20our%20deployment.%20We%20will%20use%20the%20%3CSTRONG%3E%20Add-RDServer%20%3C%2FSTRONG%3E%20cmdlet%20and%20run%20it%20on%20the%20Connection%20Broker%20this%20time.%3C%2FP%3E%0A%20%20%3CP%3EAdd-RDServer%20-Server%20RDSH01.spike.com%20-Role%20RDS-RD-SERVER%20-ConnectionBroker%20RDCBWA.spike.com%3C%2FP%3E%0A%20%20%3CP%3EWhen%20you%20run%20the%20above%20command%2C%20you%20will%20see%20the%20following%20progress%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93329iDFBCF678B95FC1FD%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93330iF53933232847D11B%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93331i0AC717259FDFD056%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93332i003A8A79C7488262%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3ERDSH01.spike.com%20is%20now%20rebooted%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93333i172D750E3EC8CAB9%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EWe%20can%20now%20verify%20the%20addition%20of%20the%20second%20Session%20Host%20server%20in%20Server%20Manager%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93334i6FA80BD1B385D3C2%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EWe%20are%20now%20ready%20to%20add%20our%20Before%20proceeding%2C%20let%E2%80%99s%20configure%20RD%20Licensing%20server.for%20our%20deployment.%20To%20install%20RD%20licensing%20role%2C%20we%20use%20the%20below%20cmdlet%3A%3C%2FP%3E%0A%20%20%3CP%3EAdd-RDServer%20-Server%20DC01.spike.com%20-Role%20RDS-LICENSING%20-ConnectionBroker%20RDCBWA.spike.com%3C%2FP%3E%0A%20%20%3CP%3EYou%20will%20now%20see%20the%20below%20progress%20messages%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93335i1974A92C3F680A6E%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93336i32192A093078795E%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93337iC698B5A9E2EE7062%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93338iA4540E1BAF564005%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EWe%20now%20need%20to%20activate%20our%20License%20server%20and%20install%20CALs%20via%20the%20Licensing%20Manager%20GUI%20on%20the%20License%20server.%20I%20have%20activated%20the%20License%20Server%20and%20installed%20PerUser%20CALs.%3C%2FP%3E%0A%20%20%3CP%3ELet%E2%80%99s%20configure%20our%20deployment%20for%20licensing.%20We%20use%20the%20below%20cmdlet%20for%20this%3A%3C%2FP%3E%0A%20%20%3CP%3ESet-RDLicenseConfiguration%20-LicenseServer%20DC01.spike.com%20-Mode%20PerUser%20-ConnectionBroker%20RDCBWA.spike.com%3C%2FP%3E%0A%20%20%3CP%3ERunning%20the%20above%20cmdlet%20requires%20confirmation%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93339i2CD6C06C72FB1968%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3ESelect%20yes%20and%20continue.%3C%2FP%3E%0A%20%20%3CP%3EWhen%20finished%2C%20it%20will%20return%20to%20the%20next%20line%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93340i9BBC1C286C0AF9C3%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3ETo%20confirm%20that%20licensing%20is%20configured%2C%20run%20the%20following%20cmdlet%3A%3C%2FP%3E%0A%20%20%3CP%3EGet-RDLicenseConfiguration%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93341i12FB522EAB8E94B2%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EWe%20can%20now%20confirm%20everything%20in%20Server%20manager%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93342i071EFC4CE0366232%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93343iAA884A3F06DB0DE9%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EWe%20are%20halfway%20done%20here%20and%20have%20completed%20the%20installation%20of%20our%20roles.%20We%20now%20need%20to%20configure%20RDS%20to%20make%20Desktop%20Sessions%20and%20RemoteApps%20available%20to%20users.%3C%2FP%3E%0A%20%20%3CP%3EThis%20takes%20us%20to%20the%20next%20step%3A%20creating%20a%20new%20collection%20using%20PowerShell.%3C%2FP%3E%0A%20%20%3CP%3EWe%20will%20create%20two%20collections%20here%20consisting%20each%20of%20the%20RDSH%20servers%2C%20with%20one%20for%20Desktop%20Sessions%20and%20the%20other%20for%20RemoteApps.%3C%2FP%3E%0A%20%20%3CP%3ETo%20create%20a%20new%20collection%2C%20we%20use%20the%20below%20cmdlet%3A%3C%2FP%3E%0A%20%20%3CP%3ENew-RDSessionCollection%20%E2%80%93CollectionName%20SessionCollection%20%E2%80%93SessionHost%20RDCBWA.spike.com%20%E2%80%93CollectionDescription%20%E2%80%9CThis%20Collection%20is%20for%20Desktop%20Sessions%E2%80%9D%20%E2%80%93ConnectionBroker%20RDCBWA.spike.com%3C%2FP%3E%0A%20%20%3CP%3EThis%20also%20shows%20a%20progress%20bar%20and%20summary%20when%20it%20finishes%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93344i057C4A3E3B10DB46%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93345iA574B5F9DDA90528%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EWe%20can%20verify%20this%20set%20up%20in%20Server%20Manager.%20As%20this%20collection%20is%20for%20Desktop%20Sessions%2C%20nothing%20else%20needs%20to%20be%20done.%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93346i72829133AB7F1824%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3ELet%E2%80%99s%20go%20ahead%20with%20creating%20the%20second%20collection%20for%20RemoteApps%3A%3C%2FP%3E%0A%20%20%3CP%3ENew-RDSessionCollection%20%E2%80%93CollectionName%20RemoteAppCollection%20%E2%80%93SessionHost%20RDCBWA.spike.com%20%E2%80%93CollectionDescription%20%E2%80%9CThis%20Collection%20is%20for%20RemoteApps%E2%80%9D%20%E2%80%93ConnectionBroker%20RDCBWA.spike.com%3C%2FP%3E%0A%20%20%3CP%3EWhen%20it%20completes%2C%20we%20see%20the%20summary%20and%20collection%20in%20Server%20Manager%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93347i9153DF1E36F87F1B%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93348i1E712BEB236C91FE%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EAs%20we%20will%20use%20this%20collection%20for%20publishing%20RemoteApps%2C%20Let%E2%80%99s%20go%20ahead%20with%20adding%20RemoteApp%E2%80%99s%20to%20it%3A%3C%2FP%3E%0A%20%20%3CP%3ENew-RDRemoteapp%20-Alias%20Wordpad%20-DisplayName%20WordPad%20-FilePath%20%22C%3A%5CProgram%20Files%5CWindows%20NT%5CAccessories%5Cwordpad.exe%22%20-ShowInWebAccess%201%20-CollectionName%20%22RemoteAppCollection%22%20-ConnectionBroker%20RDCBWA.spike.com%3C%2FP%3E%0A%20%20%3CP%3ESummary%20progress%20below%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93349iACAD7E01ADF674A6%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93350i29E55ACE5B62B58C%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EServer%20Manager%20shows%20the%20RemoteApp%20added%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93351i1490F1AA96313798%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EAnd%20with%20that%2C%20you%20are%20done!%20Users%20can%20now%20access%20the%20Desktop%20Session%20and%20Remote%20App%20Collections.%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93352i020BFCAD51182622%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EWindows%20Server%202012%20R2%20comes%20with%20enormous%20amount%20of%20PowerShell%20cmdlets.%20In%20this%20article%20we%E2%80%99ve%20only%20seen%20a%20few%20of%20them.%20We%20may%20dive%20deeper%20into%20the%20power%20of%20PowerShell%20for%20managing%20RDS%20for%20Server%202012%20R2%20in%20future%20posts.%3C%2FP%3E%0A%20%20%3CP%3EIf%20you%20are%20interested%20in%20setting%20up%20a%20VDI%20deployment%20using%20PowerShell%2C%20please%20check%20the%20link%20below%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Frds%2Farchive%2F2012%2F07%2F18%2Fsetting-up-a-new-remote-desktop-services-deployment-using-windows-powershell.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Setting%20up%20a%20new%20Remote%20Desktop%20Services%20deployment%20using%20Windows%20PowerShell%20%3C%2FA%3E%3C%2FP%3E%0A%20%20%3CP%3E-Dhiraj%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2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%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-375569%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20TECHNET%20on%20Mar%2004%2C%202015%20Hello%20AskPerf%20Readers!%20Dhiraj%20here%20from%20the%20Windows%20Performance%20team%20to%20talk%20about%20deploying%20RDS%20using%20Windows%20PowerShell%20on%20Windows%20Server%202012%20R2.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-375569%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Erds%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ERemote%20Desktop%20Services%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft
First published on TECHNET on Mar 04, 2015

Hello AskPerf Readers! Dhiraj here from the Windows Performance team to talk about deploying RDS using Windows PowerShell on Windows Server 2012 R2.

As you know, PowerShell has been around for quite a few years now (November 2006 to be exact). Over the past 8 years, we have seen PowerShell become an integral part of Windows. One such example is deploying RDS within your environment. In this blog, we are going to walk you through setting this up. With that, let’s get rolling!

Before we begin though, we need to import the RDS module using the Import-Module cmdlet:

Import-Module RemoteDesktop

We will use the New-SessionDeployment cmdlet to begin with the installation. Below is the syntax for this cmdlet:

New-SessionDeployment [-ConnectionBroker] <string> [-WebAccessServer] <string> [-SessionHost] <string[]>

Note If you are installing the Session Host on the Connection Broker, then you need to run this cmdlet on a remote server, as running it on the connection Broker will give you the following error:

The Session Host role needs a reboot after the install, and we received the above error as PowerShell cannot resume the deployment after a reboot. However, this will work in the GUI if you do the same process.

In this deployment, we will use 3 servers for the deployment:

  • RDCBWA.spike.com – RD Connection Broker, RD Web Access, and RD Session Host
  • RDSH01.spike.com – Second RD Session Host
  • DC01.spike.com – RD license server

We will need to add RDSH01 and DC01 to All Servers pool on RDCBWA before we start the deployment.

Now we run the below cmdlet on RDSH01 to install RD Connection Broker, RD Web Access and RD Session Host on RDCBWA:

New-SessionDeployment –ConnectionBroker RDCBWA.spike.com –WebAccessServer RDCBWA.spike.com –SessionHost RDCBWA.spike.com

During the install, we’ll see the following progress meters:

1. Validation begins:

2. Deployment begins:

3. Connection Broker is installed:

4. RD Web Access role is installed:

5. RD Session Host role is installed:

6. After all roles are installed, the RDCBWA.spike.com server is restarted:

Once the PowerShell setup finishes, we now go to RDCBWA.spike.com and verify the installation. As you can see from the screenshot below, everything except the RD Gateway and Licensing server have been installed. We will now add another session host and a Licensing server.

First, let’s add the second RD Session Host server to our deployment. We will use the Add-RDServer cmdlet and run it on the Connection Broker this time.

Add-RDServer -Server RDSH01.spike.com -Role RDS-RD-SERVER -ConnectionBroker RDCBWA.spike.com

When you run the above command, you will see the following progress:

RDSH01.spike.com is now rebooted:

We can now verify the addition of the second Session Host server in Server Manager:

We are now ready to add our Before proceeding, let’s configure RD Licensing server.for our deployment. To install RD licensing role, we use the below cmdlet:

Add-RDServer -Server DC01.spike.com -Role RDS-LICENSING -ConnectionBroker RDCBWA.spike.com

You will now see the below progress messages:

We now need to activate our License server and install CALs via the Licensing Manager GUI on the License server. I have activated the License Server and installed PerUser CALs.

Let’s configure our deployment for licensing. We use the below cmdlet for this:

Set-RDLicenseConfiguration -LicenseServer DC01.spike.com -Mode PerUser -ConnectionBroker RDCBWA.spike.com

Running the above cmdlet requires confirmation:

Select yes and continue.

When finished, it will return to the next line:

To confirm that licensing is configured, run the following cmdlet:

Get-RDLicenseConfiguration

We can now confirm everything in Server manager:

We are halfway done here and have completed the installation of our roles. We now need to configure RDS to make Desktop Sessions and RemoteApps available to users.

This takes us to the next step: creating a new collection using PowerShell.

We will create two collections here consisting each of the RDSH servers, with one for Desktop Sessions and the other for RemoteApps.

To create a new collection, we use the below cmdlet:

New-RDSessionCollection –CollectionName SessionCollection –SessionHost RDCBWA.spike.com –CollectionDescription “This Collection is for Desktop Sessions” –ConnectionBroker RDCBWA.spike.com

This also shows a progress bar and summary when it finishes:

We can verify this set up in Server Manager. As this collection is for Desktop Sessions, nothing else needs to be done.

Let’s go ahead with creating the second collection for RemoteApps:

New-RDSessionCollection –CollectionName RemoteAppCollection –SessionHost RDCBWA.spike.com –CollectionDescription “This Collection is for RemoteApps” –ConnectionBroker RDCBWA.spike.com

When it completes, we see the summary and collection in Server Manager:

As we will use this collection for publishing RemoteApps, Let’s go ahead with adding RemoteApp’s to it:

New-RDRemoteapp -Alias Wordpad -DisplayName WordPad -FilePath "C:\Program Files\Windows NT\Accessories\wordpad.exe" -ShowInWebAccess 1 -CollectionName "RemoteAppCollection" -ConnectionBroker RDCBWA.spike.com

Summary progress below:

Server Manager shows the RemoteApp added:

And with that, you are done! Users can now access the Desktop Session and Remote App Collections.

Windows Server 2012 R2 comes with enormous amount of PowerShell cmdlets. In this article we’ve only seen a few of them. We may dive deeper into the power of PowerShell for managing RDS for Server 2012 R2 in future posts.

If you are interested in setting up a VDI deployment using PowerShell, please check the link below:

Setting up a new Remote Desktop Services deployment using Windows PowerShell

-Dhiraj