Startup Script Problem
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Startup Script Problem

 
Post new topic   Reply to topic    Windows Server Forum Index -> Active Directory
Author Message
Keith
Guest





Posted: Mon Jan 17, 2005 6:14 pm    Post subject: Startup Script Problem Reply with 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<----------------------
Back to top
Glenn L
Guest





Posted: Tue Jan 18, 2005 8:46 am    Post subject: Re: Startup Script Problem Reply with quote

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<----------------------


Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Active Directory All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB