Since I haven't seen another post here's an example using DSQuery from a
script. It's a bit of a hack job, however it gets you where you want to
go. First time though the loop it coughs an error about 'startnode' that
you can ignore. Like I said it was quick, dirty and far from optimized.
After all what do you expect for free :)
Paste the code below into a batch file. And yes that's one continuous
line of code, no carriage returns. Note you have to use a script, it
won't run by pasting it into a CMD prompt. Be sure to change the domain
info listed in all caps to your respective domain.
@for /f %%i in ('dsquery.exe *
"cn=partitions,cn=configuration,dc=SUBDOMAIN,dc=DOMAIN,dc=COM" -filter
"(&(objectcategory=crossref)(systemflags=3))" -attr nCname') do
dsquery.exe * "%%i" -Filter
"(&(objectCategory=computer)(objectClass=computer)(primaryGroupID=516))"
-Scope Subtree -Limit 0 -Attr dnshostname operatingsystem
operatingsystemservicepack | find /v /i "operatingsystem"
>>DC-Inventory-OS-Version.LOG
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Harding, Devon
Sent: Thursday, February 23, 2006 2:07 PM
To: [email protected]
Subject: RE: [ActiveDir] Re Service Pack Level
I like this idea, but how is it run for all DC's in the forest?
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Parris
Sent: Thursday, February 23, 2006 4:03 AM
To: ActiveDir.org
Subject: [ActiveDir] Re Service Pack Level
I would use saved queries in users and computers. This way you can
dynamically watch as they drop from one query to another. If you have
W2K change the 5.2 to 5.0
DC's With SP1
(&(objectCategory=computer)(operatingSystemVersion=5.2*)(primaryGroupID=
516)
(operatingSystemServicePack=Service Pack 1))
DC's Without SP1
(&(objectCategory=computer)(operatingSystemVersion=5.2*)(primaryGroupID=
516)
(!operatingSystemServicePack=Service Pack 1))
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/
-----------------------------------------
__________________________________
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/