Configuring AD user Terminal Services settings

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Im running into a wall with a utility to create autologon users. This is a utility that replaces an old quasi working one that our desktop techs use to create and replace auto logon accounts and they often run it from the workstation they are setting up,
so some things Ive gotten working on my workstation dont work elsewhere...
Im using c# and .Net 3.5 (since we havent approved 4 to go out to everyone yet) and I am good setting everything except the terminal services settings using UserPrincipal and DirectoryEntry. (specifically Im having issues with the term services drive
letter and path, we arent setting the profile path) I know its tied to the userParameters attribute, so I can get it to something incorrect by setting that to what another user has, but not to where it should be.
Ive found that I can set this with powershell (if it isnt empty) however to do that on workstations other than mine Ive read that I need to install RSAT and the AD parts for powershell, and I cant be installing them all over the place, so that is out.
Ive also found that wtsapi32.dll is a key to being able to read and write to that file, however I cant seem to get it working at all.
Does anyone know if this can be done in straight C#, or powershell if it doesnt involve installing all kinds of stuff? (dropping folders and files silently wouldnt be a problem if that makes it work)

View the full article
 
Back
Top