Re: OSD - Adding computers to AD Group during State Restore with VBScr
- From: "Michael Niehaus [MS]" <mniehaus@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 15 Dec 2005 00:48:38 -0800
OSD only uses the advanced client network access account or the software
installation account to make connections to UNC paths; it does not actually
run with these accounts. The state restore phase is running in the context
of the computer account, and the computer account does not have permission
to do what you are looking to do.
The only workaround for this is to specify explicit credentials when making
the initial LDAP connection to AD (using OpenDSObject I believe); the
credentials specified would need to have the rights to modify the groups.
-Michael Niehaus
Systems Design Engineer
mniehaus@xxxxxxxxxxxxx
This posting is provided "AS IS" with no warranties, and confers no rights.
"Andrew Manian" <AndrewManian@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:68BEA2D0-C1BD-499E-A9D0-CCED016BD758@xxxxxxxxxxxxxxxx
> Hello.
>
> I am looking for the best way to add computers to AD groups when they are
> imaged with vanilla OSD (no BDD backend). Currently I am attempting to
> do
> this via a VBScript in the state restore phase, but this fails. The
> script
> works fine when run manually, but does not work via OSD state restore,
> which
> is set to run using the software installation account (domain admin).
> The
> Is anyone else doing this, who could provide any pointers/direction? Im
> a
> bit of an OSD newb. Here is the code I am running today.
> '-----------------------------------------------------------------------
> On Error Resume Next
>
> Set sho = CreateObject("Wscript.Shell")
>
> Dim oGroup, objLDAP
>
> PCNAME =
> sho.regread("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName\ComputerName")
>
> objLDAP = "LDAP://CN={TARGET GROUP NAME},OU=" & "IT" & ",OU=" &
> "departments" & ",DC=corp,DC={Company Name},DC=com"
>
> Set oGroup = GetObject(objLDAP)
>
> oGroup.Add ("LDAP://CN=" & PCNAME &
> ",ou=computers,ou=departments,DC=corp,DC={Company Name},DC=com")
>
> Set oGroup = Nothing
>
> '-----------------------------------------------------------------------
>
> TIA!
>
> /[
.
- Follow-Ups:
- Re: OSD - Adding computers to AD Group during State Restore with VBScr
- From: Kristian F. Thomsen
- Re: OSD - Adding computers to AD Group during State Restore with VBScr
- Prev by Date: Re: OSD - Adding computers to AD Group during State Restore with VBScr
- Next by Date: Re: OSD - Adding computers to AD Group during State Restore with VBScr
- Previous by thread: Re: OSD - Adding computers to AD Group during State Restore with VBScr
- Next by thread: Re: OSD - Adding computers to AD Group during State Restore with VBScr
- Index(es):
Relevant Pages
|