Modify Terminal Services Profile Properties for a User Account

Configures Terminal Services profile attributes for the MyerKen Active Directory user account.

 
 
 
 
 
5 Star
(1)
Add to favorites
8/10/2009
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Error running this script
    1 Posts | Last post June 16, 2017
    • When running the script I get object does not support this property or method error
      
      Error Code : 800A01B6
      
      My code as below.
      
      Set objRootDse = GetObject("LDAP://RootDSE")
      strQueryFrom = "LDAP://" & objRootDse.Get("defaultNamingContext")
      Const ADS_SCOPE_SUBTREE = 2
      Set objConnection = CreateObject("ADODB.Connection")
      Set objCommand = CreateObject("ADODB.Command")
      objConnection.Provider = ("ADsDSOObject")
      objConnection.Open "Active Directory Provider"
      objCommand.ActiveConnection = objConnection
      objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
      objCommand.Properties("Page Size") = 3000
      
      sso=inputbox("Enter User's SSO : ")
      objCommand.CommandText = "Select ADsPath from '" & strQueryFrom & "' where SAMAccountName='" & sso & "'"
      Set objRecordSet = objCommand.Execute
      objRecordSet.MoveFirst
      ads=objrecordset(0)
      msgbox ads
      Set objUser = GetObject(ads) 
      objUser.TerminalServicesProfilePath = "\\server1\share1\" & sso
      objUser.TerminalServicesHomeDirectory = "\\server1\share2\" & sso
      objUser.TerminalServicesHomeDrive = "P:" 
      objUser.SetInfo
      
      Please advise.
  • "connect" z: "to" \\test\test rather than local path
    1 Posts | Last post May 12, 2012
    • i pasted this code into a excel macro:
      
      Const Enabled = 1 
      Const Disabled = 0 
       
      Set objUser = GetObject _ 
          ("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com") 
        
      objUser.TerminalServicesProfilePath = "\\test" 
      objUser.TerminalServicesHomeDirectory = "\\test" 
      objUser.TerminalServicesHomeDrive = "z:" 
      objUser.AllowLogon = Enabled 
      objUser.SetInfo 
      
      
      it works but not exactly like i need. i want to select "connect" z: "to" \\test\test rather than local path. how do i make that change?