Quick question regarding Terminal Services Home Folders

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Jonas Andresen Jonas Andresen 3 years, 3 months ago.

  • Author
    Posts
  • #12769
    Profile photo of Jonas Andresen
    Jonas Andresen
    Participant

    I need to move a buttload of home directories which I have covered with the following command.

    Get-Content c:\scripts\test.txt | Foreach-Object {set-aduser $_ -HomeDirectory "\\ourserver\homedir\$_"}

    But that only covers the home directory. How can I change the Terminal Services Home Folder?
    Also known as the Remote Desktop Services Home Folder:
    Screenshot of the attribute I need to change.

    I checked the attribute editor and found nothing. I checked set-aduser and get-aduser's get-help list and didnt find anything.
    How can I edit this attribute from Powershell?

  • #12770
    Profile photo of selko
    selko
    Participant

    Hi,

    i did this with ADSI

    $ou = [adsi]"$($OU)"
    $user = $ou.psbase.get_children().find($DN)

    $user.psbase.invokeSet("allowLogon",1)
    $user.psbase.invokeSet("TerminalServicesHomeDirectory","$($HomeDirPathValue)")
    $user.psbase.invokeSet("TerminalServicesProfilePath","$($ProfileDirPathValue)")
    $user.psbase.invokeSet("TerminalServicesHomeDrive",$HomeDriveValue)
    $user.setinfo()

  • #12779
    Profile photo of Jonas Andresen
    Jonas Andresen
    Participant

    Hey Selko,

    Oh that's pretty cool. Haven't heard of that before.

    Just wondering how this finds the correct OU? Doesnt it just .. search for itself?

You must be logged in to reply to this topic.