RE: Find SP2 - [WILDPACKET]

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thank you ESP for your response.

I am not the scripting guy, ok, I will run this script after making the
appropriate changes, will this script generate a file as output or how will
it show the PCs which are running SP1 only?

Please advise.





"ESP" wrote:

> Yea, but this will. Took me a few minutes to re-write it.
> ESP
>
>
> On Error Resume Next
> Const ADS_SCOPE_SUBTREE = 2
> strContainer = "DC=YourDomain,DC=com"
> Set objConnection = CreateObject("ADODB.Connection")
> Set objCommand = CreateObject("ADODB.Command")
> objConnection.Provider = ("ADsDSOObject")
> objConnection.Open "Active Directory Provider"
> objCommand.ActiveConnection = objConnection
> objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
> objCommand.Properties("Page Size") = 1000
> objCommand.CommandText = _
> "SELECT CN, operatingSystemVersion, operatingSystemServicePack " _
> & "FROM 'LDAP://"; & strContainer & "' " _
> & "WHERE objectCategory='computer' " _
> & "AND operatingSystemVersion = '5.1 (2600)' " _
> & "AND operatingSystemServicePack = 'Service Pack 2'"
> Set objRecordSet = objCommand.Execute
> objRecordSet.Sort = "CN"
> objRecordSet.MoveFirst
> Do Until objRecordSet.EOF
> Wscript.Echo
> Wscript.Echo objRecordSet.Fields("CN").Value
> Wscript.Echo String(Len(objRecordSet.Fields("CN").Value), "-")
> Wscript.Echo " " & objRecordSet.Fields("operatingSystemVersion").Value
> Wscript.Echo " " & objRecordSet.Fields("operatingSystemServicePack").Value
> objRecordSet.MoveNext
> Loop
>
>
>
>
>
>
>
> "WILDPACKET" wrote:
>
> > Thank you for your reply.
> >
> > That did not work.
> >
> >
> >
> > "ESP" wrote:
> >
> > > I could be wrong, but if I remember correctly, I believe you use an AND
> > > between these, not ()
> > >
> > > (&(&(&(&(&( WHERE objectCategory=Computer AND operatingSystem=Windows XP
> > > Professional AND operatingSystemServicePack=Service Pack 1))))))
> > >
> > > ESP
> > >
> > >
> > >
> > >
> > > "WILDPACKET" wrote:
> > >
> > > > Any body has a script which will find all the Windows XP Clients running SP2
> > > > our find SP1 in our domain?
> > > >
> > > >
> > > > ******************************
> > > > Have this LDAP Query.
> > > >
> > > > (&(&(&(&(&(objectCategory=Computer)(operatingSystem=Windows XP
> > > > Professional)(!operatingSystemServicePack=Service Pack 1))))))
> > > >
> > > > This query works but also picks up all the XP PCs which are also running
> > > > SP2. I just want the query to pick SP1 PCs. Any ideas any thing wrong with
> > > > this query?
> > > >
> > > > Please advise.
> > > >
> > > > Thank you
> > > >
.



Relevant Pages

  • SQL field problem
    ... I have written s script which returns me various objects, ... corrseponding fields. ... loop through, returning the fields which actually contain a value for ... Set objRecordSet = CreateObject ...
    (microsoft.public.scripting.vbscript)
  • RE: Script to retrieve a list of machines from AD
    ... first guess user rights ... ... Before i posted the script i had run a test in my vmware - without any probs. ... >> Set objRecordSet = objCommand.Execute ...
    (microsoft.public.scripting.vbscript)
  • Re: delete files in a folder that are certain days old
    ... "Rob Moerland" wrote: ... > ESP wrote: ... > I was looking for the answer a week ago and found FORFILES on my W2k3 ... > Maybe a .CMD script or a .vbs script using Runis the easy way. ...
    (microsoft.public.scripting.vbscript)
  • RE: Script to retrieve a list of machines from AD
    ... I have modified the script and when I ... >> Set objCOmmand.ActiveConnection = objConnection ... >> Set objRecordSet = objCommand.Execute ...
    (microsoft.public.scripting.vbscript)
  • RE: delete files in a folder that are certain days old
    ... In my scenario I want to schedule the files to be deleted which are older ... ESP" wrote: ... I found this script on the net and I would like to ... >> 'Walk through each file in this folder collection. ...
    (microsoft.public.scripting.vbscript)