Код:
Option Explicit
Dim objUsers4Exclude
Dim objIADsContainer
Dim objIADsUser
Set objUsers4Exclude = WScript.CreateObject("Scripting.Dictionary")
With objUsers4Exclude
.Add "Администратор", ""
.Add "Гость", ""
.Add "Вася", ""
.Add "Петя", ""
.Add "Коля", ""
End With
Set objIADsContainer = GetObject("WinNT://" & WScript.CreateObject("WScript.Network").ComputerName & ",computer")
objIADsContainer.Filter = Array("user")
For Each objIADsUser In objIADsContainer
If Not objUsers4Exclude.Exists(objIADsUser.Name) Then
objIADsUser.Profile = "C:\My Path to user's profiles\" & objIADsUser.Name
objIADsUser.SetInfo
End If
Next
objUsers4Exclude.RemoveAll
Set objUsers4Exclude = Nothing
Set objIADsContainer = Nothing
WScript.Quit 0