Here is such a script.  Just unrem the correct strOS line that you're
working with and set strSource and strDestination to the correct values
for your environment.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Coleman, Hunter
Sent: Wednesday, August 24, 2005 5:19 PM
To: [email protected]
Subject: RE: [ActiveDir] GPO on XP & 2000 Pro

I'd create the Workstations OU and the Servers OU. Then write a script
that looks at each of the machines in the computers container, and based
on what you find in the operatingSystem attribute have the script move
the object to the appropriate OU.

I'd also not leave new computer objects in the computers container. 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Harding, Devon
Sent: Wednesday, August 24, 2005 4:04 PM
To: [email protected]
Subject: RE: [ActiveDir] GPO on XP & 2000 Pro

I have over 2000 machines in my computers containers.  Is there any
other way?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Darren Mar-Elia
Sent: Wednesday, August 24, 2005 5:53 PM
To: [email protected]
Subject: RE: [ActiveDir] GPO on XP & 2000 Pro

WMI filters aren't processed by Win2K so that won't work on that
platform. Your best bet is probably to put all the XP & win2k machines
in one security group and then security filter the GPO based on that
group (i.e. remove the Authenticated Users ACE from the sec. filter on
that GPO and add the new group with Read and Apply GP permissions). 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Harding, Devon
Sent: Wednesday, August 24, 2005 2:40 PM
To: [email protected]
Subject: [ActiveDir] GPO on XP & 2000 Pro

How can I get a GPO to only run on all Windows XP and 2000 Pro. machines
in a domain?  WMI Filter is applied to 2000 machines so it'll run on
2000 server if I filter by OS type.

Devon Harding
Windows Systems Engineer
Southern Wine & Spirits - BSG
954-602-2469


-----------------------------------------
__________________________________
This message and any attachments are solely for the intended recipient
and may contain confidential or privileged information.  If you are not
the intended recipient, any disclosure, copying, use or distribution of
the information included in the message and any attachments is
prohibited.  If you have received this communication in error, please
notify us by reply e-mail and immediately and permanently delete this
message and any attachments.  Thank You.

List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive:
http://www.mail-archive.com/activedir%40mail.activedir.org/
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive:
http://www.mail-archive.com/activedir%40mail.activedir.org/
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive:
http://www.mail-archive.com/activedir%40mail.activedir.org/
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive:
http://www.mail-archive.com/activedir%40mail.activedir.org/
Option Explicit
Dim strBase, strFilter, strAttrs, strScope
Dim oConnAD, oRSAD
Dim strOS
Dim strSource, strDestination
Dim strADDN, strADName
Dim oOU

'strOS = "Windows XP Professional"
'strOS = "Windows 2000 Professional"
'strOS = "Windows 2000 Server"
strOS = "Windows Server 2003"
strSource = "LDAP://CN=Computers,DC=evangel,DC=edu"
strDestination = "LDAP://OU=W2K3Servers,DC=evangel,DC=edu"
Set oOU = GetObject(strDestination)

strBase     =  "<" & strSource & ">;"
strFilter   = "(operatingSystem=" & strOS & ");"
strAttrs    = "distinguishedName,Name;"
strScope    = "subtree"

Set oConnAD = CreateObject("ADODB.Connection")
oConnAD.Provider = "ADsDSOObject"
oConnAD.Open "Active Directory Provider"
Set oRSAD = oConnAD.Execute(strBase & strFilter & strAttrs & strScope)

While Not oRSAD.EOF
        strADDN = oRSAD.Fields(0)
        strADName = oRSAD.Fields(1)
  oOU.MoveHere "LDAP://" & strADDN, "cn=" & strADName
        oRSAD.MoveNext
Wend

Set oOU = nothing
oRSAD.Close
Set oRSAD = nothing
oConnAD.Close
Set oConnAD = nothing

Reply via email to