![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Scripting Active Directory User Objects Hello All just a quick question, I would like to set users in AD with one attribute - Terminal Server Profile. User profiles are stored centrally somewhere. I need to make all current 100 users' terminal server profile point to that location and using the user logon name as profile folder name. Currently the fields are blank, can that be done using VBscript? And how? Thanks Ben |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Scripting Active Directory User Objects Benny Van wrote: Quote: > just a quick question, I would like to set users in AD with one > attribute - Terminal Server Profile. User profiles are stored > centrally somewhere. I need to make all current 100 users' terminal > server profile point to that location and using the user logon name as > profile folder name. Currently the fields are blank, can that be done > using VBscript? > http://www.microsoft.com/technet/scr.../tsusvb11.mspx You need some way to bind to the 100 users in a loop and repeat code from the link. I assume by "user logon name" you mean the "pre-Windows 2000 logon" name, which is the value of the sAMAccountName attribute of the user object. For example, to configure all users in an OU the code could be similar to: ======== ' Specify terminal server profile path. strPath = "\\MyServer\MyShare" ' Bind to OU using Distinguished Name of OU. Set objOU = GetObject("LDAP://ou=West,dc=MyDomain,dc=com") ' Filter on user objects. objOU.Filter = Array("user") ' Enumerate all users in OU. For Each objUser In objOU ' Retrieve logon name. strName = objUser.sAMAccountName ' Assign Profile Path. objUser.TerminalServicesProfilePath = strPath & "\" & strName objUser.SetInfo Next ======= If instead the 100 users are members of a group, you can enumerate the members of the group. In brief: ====== ' Bind to group object using Distinguished Name of group. Set objGroup = GetObject("LDAP://cn=TSGroup,ou=West,dc=MyDomain,dc=com") ' Enumerate direct members of group. For Each objUser In objGroup.Members '.... same as above. Next -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Active directory - object deletion with comparison to SMS 2003 objects | PowerShell | |||
| SCRIPTING DFS and Active Directory | VB Script | |||
| Problems obtaining user properties from Active Directory | PowerShell | |||
| accountExpire user attribute in Active Directory | PowerShell | |||
| Active Directory | Vista networking & sharing | |||