0

Not been able to find a way to programatically add User Profiles to a server (Server 2012). I've already created a process that adds User Accounts to the domain programatically... but from what I can find their doesn't seem to be a way to then take these new user accounts and add them as profiles to a selected server itself... (i.e. logging into the server for the first time with the user account to create the profile within that server)

I know Administrators must have some sort of automated process to do this... imagine having to add hundreds of user profiles manually every time you get a new server!!

If at all possible I would prefer to complete this in C#, but if anyone could point me in the right direction in any language I would greatly appreciate it.

Additional Note: To further clarify... I actually need to create the user profile because after the profile has been created I can then modify Environment Tab Settings i.e. Starting Program: "Start the Following Program at Logon"

If I set these settings before I create the desktop location it will error on new user login and not create the profile in my experience. So the only order that I have know to work is 1st logon, then add the Starting Program settings, and lastly go to the account tab and check "User must change password at next logon". If anyone knows of an alternative way to do this that would be great as well.

  • Of course there’s an automated process. Join domain, the end. I don’t get what you’re trying to accomplish at all – Daniel B Aug 11 '15 at 20:50
  • The users have been already added to the domain as stated... I am now trying to automatedly add the user profiles to different machines across the domain. When you add new users to the domain this does not create there user profile on each server until they logon for the first time @DanielB – Anthony Griggs Aug 11 '15 at 20:54
  • Yeah, and what’s the problem with that? It takes Windows about 10 seconds to create a profile from scratch. – Daniel B Aug 11 '15 at 20:56
  • Your correct... it's not much of a problem for a few users... but when you create a new server and suddenly have to logon one by one to hundreds of user accounts just to create a user profile it gets to be annoying.... @DanielB – Anthony Griggs Aug 11 '15 at 20:58
  • No, again: Why are you trying to preseed the user profiles in the first place. It is completely pointless. – Daniel B Aug 11 '15 at 21:00
0

First of all I agree with the comments on why would you want to do it but still...

Personally I'd use PowerShell rather than C# (and stackoverflow would be the place to ask such questions). The sensible place to work with a Windows Domain is through Group Policy. The process is described on technet:

This topic describes how to use Windows Server to deploy Roaming User Profiles to Windows client computers.

A server is a client computer.

  • I've added an additional note that explains why I need to do this process – Anthony Griggs Aug 11 '15 at 21:15
  • 1
    Not knowing what it is it would seem something that should be done a GPO level and be crafted in such a way that it applies at the computer level and only the minimum is configured per user. However, I understand that may be beyond your control - i.e. legacy – albal Aug 11 '15 at 21:18
  • Following your advice I did post on StackOverflow... and as I thought no response so far. I am a developer and have the mind set of accomplishing this programatically... Which is why I posted here as I figured those knowledgeable of server administration would know the right way to do this... I didn't know starting a program could be acomplished via a group policy... does it work the same (i.e. when a user closes the app it logs off the session?) @albal – Anthony Griggs Aug 12 '15 at 0:38
  • @AnthonyGriggs Group Policy does not execute or handle events, it can however load in the required scripts that may be executed at login, logoff, startup etc. – albal Aug 12 '15 at 9:08
  • Thank you and sorry... don't have enough credentials yet to upvote on this forum as I am new to it. But I did award you the answer. – Anthony Griggs Aug 13 '15 at 23:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.