Overclock.net banner

1 - 3 of 3 Posts

·
Back to Building
Joined
·
4,863 Posts
Discussion Starter #1
Hey all,

Creating a program at work to automate our new hire process (using VB for the UI and powershell for the execution).

It's nothing fancy but it is coming along well so far except for one item in particular I am stuck on, setting the terminal service profile in. (Profile path, home drive, home drive path).

I have found the code to change it for someone who already has a path and I need to change it to something else but the issue I am finding is that for a brand new user I am unable to set the info.

I was reading this site

https://alwinperotti.wordpress.com/2013/08/05/get-the-remote-desktop-services-profile-path-terminal-services-profile-path-with-powershell/

and instead of the invokeget to get the info I did an invokeset and it worked for changing someone elses path to something else but failed stating It couldn't find the info when trying to set it on a new user.

any thoughts?
 

·
Registered
Joined
·
1,589 Posts
ooo I have no experience in VB or powershell, but do have experience of user profiles in my capacity as a network admin a good few years back (it was an NT 4.0 environment).

From what I can gather, you're creating a new user, then trying to set new paths on the profile. Where I think you may be getting stuck, is trying to change info which isn't created yet. The new user profile won't be created till you try and log that user on, it is at that point the new user profile is created. It will only be after that, that you could use the invokeset to change the info. I think what you may have to do, is find some way to automatically log the new user in, then back out, once the new user profile is created, and then try to set the data.

also, If i remember right, I didn't need to do any of that, I'm sure we just set the stuff up in the default profile (where windows gets it's new user info from), so maybe you need to be looking at altering the default profile, which should then automatically pull in the info you want at first logon of the new user. I wish I could remember more, but maybe it'll give you a couple of ideas of where to look.

Good luck!
 

·
Back to Building
Joined
·
4,863 Posts
Discussion Starter #3
Quote:
Originally Posted by latelesley View Post

ooo I have no experience in VB or powershell, but do have experience of user profiles in my capacity as a network admin a good few years back (it was an NT 4.0 environment).

From what I can gather, you're creating a new user, then trying to set new paths on the profile. Where I think you may be getting stuck, is trying to change info which isn't created yet. The new user profile won't be created till you try and log that user on, it is at that point the new user profile is created. It will only be after that, that you could use the invokeset to change the info. I think what you may have to do, is find some way to automatically log the new user in, then back out, once the new user profile is created, and then try to set the data.

also, If i remember right, I didn't need to do any of that, I'm sure we just set the stuff up in the default profile (where windows gets it's new user info from), so maybe you need to be looking at altering the default profile, which should then automatically pull in the info you want at first logon of the new user. I wish I could remember more, but maybe it'll give you a couple of ideas of where to look.

Good luck!
Thanks for the reply,

Yeah every single other attribute of the users profile I had no issues setting but for whatever reason Microsoft made this one section different.

Probably not the most ideal way but I was able to create a "template" user of the sorts with no info set except for the Terminal service profile info so when I create the new user it copies that data and then I am able to change the data to what I want on the new user.
 
1 - 3 of 3 Posts
Top