Quick question regarding Terminal Services Home Folders

Welcome Forums General PowerShell Q&A Quick question regarding Terminal Services Home Folders

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
5 years ago.

  • Author
    Posts
  • #12769

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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?

The topic ‘Quick question regarding Terminal Services Home Folders’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort