Skip Links

Network World

Tyson Kopczynski

RDC RemoteApp: How do users change their password?

How to create a password change GUI for RemoteApp using PowerShell.

By tyson.kopczynski on Mon, 05/31/10 - 10:52pm.

***UPDATE***

Here is the source: http://poshcode.org/1910

*************

I recently ran into a very interesting scenario with RDC RemoteApp. Basically, we had a client that was using RDC RemoteApp to deploy a medical related application. For their deployment scenario they wanted to create and distribute RDP files to remote users who were not on the organization’s internal network. After semi-going live with their deployment they turned to us and asked, “What about password changes?”

To be honest, I never gave password changes much thought with RemoteApp. After all, with most deployments the user has a desktop that is a member of the domain or they are coming through Web Access and we can front the password changes with something like UAG. However, with just RemoteApp via an RDP file on a non-domain member machine there really isn’t a way for users to change their password. Yes, you heard me correctly… there isn’t a way for users to change their password or get notified about impending password expiration.

To understand why this is the case you have to take two things into consideration about RemoteApp. First, the primary feature of RemoteApp is that it provides seamless windows. In other words, the application looks like it is running locally on the user’s machine. Secondly, to achieve its seamless windows magic, RemoteApp does not use Windows Explorer as the user’s shell on the RDS Session Host server. Instead, it uses RDPSHELL.EXE which loads a set of Windows event hooks into the user’s session that allow it to monitor and manage the state of all windows on the desktop. As a result, the following things are true about a RemoteApp session:

  1. A user doesn’t see the desktop of the RemoteApp session.
  2. A user doesn’t see password notifications.
  3. Login scripts are not processed unless specified using a GPO.
  4. Dialog boxes from a logon script and sometimes from the published application itself are not shown.

So… how does one work around the features of RemoteApp to allow users to change their passwords? Well the solution that I came up with involves PowerShell. While I can’t necessarily publish the source code, I can describe what I did.

Overall, I needed to provide users with a GUI to change their passwords. However, to work around RemoteApp, I had to basically write a PowerShell based GUI that was then published as the intended application. Then depending on the outcome of this GUI the actual intended application was started and the password change GUI was closed. To create the password change solution the following steps were used:

  1. First, download the PowerShellPack: http://code.msdn.microsoft.com/PowerShellPack.
  2. Next, grab the WPK module from the PowerShellPack and copy it into the folder that will house the future password change script.
  3. Next, write a PowerShell script that does the following:
    1. Imports the WPK module.
    2. Determine when the logged on user’s password is going to expire (password policy settings can either be hard coded or determined from Active Directory).
    3. If the user’s password isn’t going to expire in a specified minimum period (say 10 days). Then intended application is just started.
    4. If the user’s password is going to expire in 10 days a password change GUI is displayed using the WPF cmdlets from the WPK module. With my GUI there were three PasswordBoxs (current password, new password, and confirm new password), two buttons (change and cancel), and a TextBlock for displaying messages.
      1. For times when the user’s password will expire within 10 days and greater then one day the GUI allows the user to cancel and launch the application.
      2. For times when the user’s password will expire in some maximum period (say less than one day) the cancel button is disabled.
    5. When a user has filled in the correct password information (old and new) they can click Change. Upon clicking Change, the Password method of the DirectoryEntry class is used to change the user’s password. Once the password has been changed, the password change GUI is closed and the intended application is started.
  4. Next, a batch file needs to be created that executes the PowerShell script using the following command: powershell.exe -STA -NoProfile -WindowStyle Hidden -Command "C:\PassMan\PassMan.ps1". Notice the usage of the Hidden WindowStyle. This ensures that the PowerShell console is not shown to the user when the script is executed.
  5. Finally, copy the password change GUI to all of the RDC Session Host servers and publish the batch file as a RemoteApp.

Hopefully this helps someone…

If you like this, check out some other posts from Tyson:

Or if you want, you can also check out some of Tyson's latest publications:

Lastly, visit the Microsoft Subnet for more news, blogs, and opinions from around the Internet. Or, sign up for the bi-weekly Microsoft newsletter. (Click on News/Microsoft News Alert)

What is Tech Briefcase?
TechBriefcase is a new, free service where IT Professionals can Search, Store and Share IT white papers and content like this. Learn more
Bookmark content
Speed up your research efforts with content across the web.
Search and Store
Find the white papers you need. Create folders for any topic.
View Anywhere
Open your briefcase on your iPhone, tablet or desktop. Share with colleagues.
Don't have an account yet?
About Hidden Microsoft

With more than ten years of experience in IT, Tyson Kopczynski has become a specialist in Active Directory, Information Assurance, Windows automation, PKI, and IT security practices. Tyson is also the founding author of the Windows PowerShell Unleashed series and has been a contributing author for such books as Microsoft Internet Security and Acceleration (ISA) Server 2006 Unleashed and Microsoft Windows Server 2008 R2 Unleashed. He has also written many detailed technical papers and guides covering various technologies. As a consultant at Convergent Computing, Tyson works with and provides feedback for next generation Microsoft technologies since their inception and has also played a key role in expanding the automation and security practices at CCO. Tyson also holds such certifications as the Certified Information Systems Security Professional (CISSP), the SANS Security Essentials Certification (GSEC) and SANS Certified Incident Handler (GCIH), and the MCTS (Application Platform, Active Directory, and Network Infrastructure).


Certifications:

  • Certified Information Systems Security Professional (CISSP)
  • SANS GIAC Security Essentials Certification (GSEC)
  • SANS GIAC Certified Incident Handler (GCIH)
  • MCTS (Application Platform, Active Directory, and Network Infrastructure)
  • Microsoft Certified Systems Engineer (MCSE) Security
  • CompTIA Security+

Publications:


Other Stuff:

  • Blogger NetworkWorld.com from June 2007
  • GIAC Advisory Board from 2009
  • Lecturer / Speaker (Information Technology or Security related)
  • SANS Local Mentor (active in Japan)
  • CompTIA Security+ SME (a long time ago)
  • Judge, Imagine Cup 2005 Int'l IT Competition
  • Judge, Imagine Cup 2007 Int'l IT Competition
 

Most Discussed Posts

On The Web
LinkedIn