Thursday, August 30, 2012 2:18 PM
I want to modify 100 users logon workstation in single shot.
When I asked question in forum http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/346231f3-6a68-4587-8ea6-8bffd0342895
I was redirected to the below scripting url, now I want to change 100users logon workstations using your script with input file as xls or whichever way you suggest, please help.
- Edited by Anil Kumar H Thursday, August 30, 2012 2:19 PM
Thursday, August 30, 2012 5:46 PMModerator
And your question is?
Wait, you're not suggesting that some unpaid volunteer should write you a script, are you? If that's what you have in mind, I have to tell you that that's not how it works around here. Please read the first two permanent posts in this forum, follow their guidance and come back with specific questions about any particular part of the solution that you're having problems with. Then I'm pretty sure someone would be more than happy to give you some help.
As a starter, try looking up file handling in the Windows Script Host documentation. It illustrates the reading of a text or CSV file. I would suggest that Excel is beyond your skill or need level right now, though it is entirely doable.
Thursday, August 30, 2012 8:46 PMModerator
The attribute of AD user objects for specifying computers they are allowed to logon to is userWorkstations. This is a single-valued string attribute. The value should be the NetBIOS names of the allowed computers, comma delimited (in one string). You need to bind to each user object (using the distinguished name) and assign a value. In brief:
Will the spreadsheet have user DN's in one column and the new value for userWorkstations in another column? Or, will all users get the same value for userWorkstations? If your source is "pre-Windows 2000 logon names" (sAMAccountName instead of DN), the script will need to convert this into distinguishedName (DN).
You can find examples of VBScript programs to read values from a spreadsheet in the Script gallery. I have a simple example linked here:
This example is actually a good one for your situation, as it reads user DN's and other values, binds to each user, and assigns the values to attributes. You just need to modify for the userWorkstations attribute.
Richard Mueller - MVP Directory Services
- Marked As Answer by IamMredMicrosoft Employee, Owner Monday, September 10, 2012 5:25 AM