This a solution may be useful to solve this problem:
Use the GPO to add a start up script to add a domain user account to this PC.
Use the GPO -> Computer policy -> add the bat and vbs to startup script and add the GPO to the Computer OU
The bat file is used to run the following script:
Script to add domain user account to local Administrators group (From Rod Trent - rtrent [at] swynk [dot] com)
Dim DomainName
Dim UserAccount
Set net = WScript.CreateObject("WScript.Network")
local = net.ComputerName
DomainName = "DomainName"
UserAccount = "userAccount"
set group = GetObject("WinNT://"& local &"/Administrators")
on error resume next
group.Add "WinNT://"& DomainName &"/"& UserAccount &""
CheckError
sub CheckError
if not err.number=0 then
set ole = CreateObject("ole.err")
MsgBox ole.oleError(err.Number), vbCritical
err.clear
else
MsgBox "Done."
end if
end sub
http://www.enterpriseitplanet.com/resources/scripts_win/article.php/3083571
No comments:
Post a Comment