I need to find a way to add a Domain user to all the PC's Local Admin Group via a vb script. I found this script that was posted in 2004 and seems to do just what I need.
************************************
Set oWshNet = CreateObject("WScript.Network" )
' suppress errors in case the user is already a member
On Error Resume Next
oGroup.Add(oUser.ADsPath)
On Error Goto 0
**************************************
When logged on as administrator the script works perfectly. I then applied it as a logon script to one of our special accounts. The script fails due to the account not having the correct permisions. I then set it to run as a startup script to each of our computers. It fails again this time at
Line: 9
Char: 1
Error: 0x080005000
Code: 80005000
Source: Null
Any ideas as to why I am having difficulties running this script.
Our network is a Windows 2003 AD Multysite Domain running 500 Windows XP work stations.