Keith
Guest
|
Posted:
Mon Jan 17, 2005 6:14 pm Post subject:
Startup Script Problem |
|
|
I am trying to execute a VBS script at startup but keep getting an error.
The script is to add a network group to the local admin group of the
machine.
Scrpt executes fine if run manually, so I know there is nothing wrong with
it, but fails if run as a GPO startup script.
Error is: 0x80005000 on Line 11
Any help please?
'--------------------8<----------------------
Set oWshNet = CreateObject("WScript.Network")
sGroup = "Local Admins"
sNetBIOSDomain = oWshNet.UserDomain
sComputer = oWshNet.ComputerName
Set oGroup = GetObject("WinNT://" & sComputer & "/Administrators,group")
Set oUser = GetObject("WinNT://" & sNetBIOSDomain & "/" & sGroup & ",group")
' suppress errors in case the user is already a member
On Error Resume Next
oGroup.Add(oUser.ADsPath)
On Error Goto 0
'--------------------8<---------------------- |
|
Glenn L
Guest
|
Posted:
Tue Jan 18, 2005 8:46 am Post subject:
Re: Startup Script Problem |
|
|
C:\Tools>err.exe 80005000
# for hex 0x80005000 / decimal -2147463168 :
E_ADS_BAD_PATHNAME adserr.h
# An invalid directory pathname was passed
# 1 matches found for "80005000"
Here is what the return code means.
You might want to run a network trace at the authenticating DC when it works
and when it doesn't work.
I suspect the script may not even be putting anything on the wire when it
fails.
--
Glenn L
CCNA, MCSE 2000/2003 + Security
"Keith" <@.> wrote in message news:ed8cwUJ$EHA.208@TK2MSFTNGP12.phx.gbl...
| Quote: | I am trying to execute a VBS script at startup but keep getting an error.
The script is to add a network group to the local admin group of the
machine.
Scrpt executes fine if run manually, so I know there is nothing wrong with
it, but fails if run as a GPO startup script.
Error is: 0x80005000 on Line 11
Any help please?
'--------------------8<----------------------
Set oWshNet = CreateObject("WScript.Network")
sGroup = "Local Admins"
sNetBIOSDomain = oWshNet.UserDomain
sComputer = oWshNet.ComputerName
Set oGroup = GetObject("WinNT://" & sComputer & "/Administrators,group")
Set oUser = GetObject("WinNT://" & sNetBIOSDomain & "/" & sGroup &
",group")
' suppress errors in case the user is already a member
On Error Resume Next
oGroup.Add(oUser.ADsPath)
On Error Goto 0
'--------------------8<----------------------
|
|
|