Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Reports in many combinations...

Posted on 2007-09-30
14
Medium Priority
?
250 Views
Last Modified: 2010-04-16
Hi,

I want a script with which i can take reports in many combinations/To check /To see the blanks etc...

I want a script that can get these details from the ADS users and computers properties.
Each differerent script
Office
Extension
Mobile
Title
Designation
Company
Each with the name if blank then leave the blank.From a particular OU.
For the Computer the description and Location.

Regards
Sharath
0
Comment
Question by:bsharath
  • 7
  • 7
14 Comments
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 20114090
I don't see any 'Extension' or 'Designation' fields in user properties!!
0
 
LVL 11

Author Comment

by:bsharath
ID: 20114098
Extension is the General Tab > Telephone Number  and Designation is the Title box in Organisation tab
0
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 20114124
Click Start -> Run -> Cmd.exe -> OK

For users:

DSQuery * -Filter "(&(sAMAccountType=805306368)(|(!physicalDeliveryOfficeName=*)(!telephoneNumber=*)(!mobile=*)(!title=*)(!Company=*)))" >Users.txt

For Computers:

DSQuery * -Filter "(&(objectClass=computer)(|(!location=*)(!description=*)))" >Computers.txt

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
LVL 11

Author Comment

by:bsharath
ID: 20114735
Farhan i get this...

C:\>DSQuery * -Filter "(&(sAMAccountType=805306368)(|(!physicalDeliveryOfficeNam
e=*)(!telephoneNumber=*)(!mobile=*)(!title=*)(!Company=*)))" >Users.txt
Dsquery has reached the default limit of 100 results to display; use the -limit
option to display more results.

Any help the other Q's....
0
 
LVL 11

Author Comment

by:bsharath
ID: 20117150
I get this...

C:\>DSQuery * -Filter "(&(objectClass=computer)(|(!location=*)(!description=*)))
" >Computers.txt
Dsquery has reached the default limit of 100 results to display; use the -limit
option to display more results.

0
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 20117559
For users:

DSQuery * -Filter "(&(sAMAccountType=805306368)(|(!physicalDeliveryOfficeName=*)(!telephoneNumber=*)(!mobile=*)(!title=*)(!Company=*)))"  -Limit 0 >Users.txt

For Computers:

DSQuery * -Filter "(&(objectClass=computer)(|(!location=*)(!description=*)))" -Limit 0 >Computers.txt
0
 
LVL 11

Author Comment

by:bsharath
ID: 20117685
For the computers Dsquery i just get this,

"CN=DEV-CHEN-PC632,CN=Computers,DC=Development,DC=Group,DC=co"

For users i just get this...

"CN=Gino Salvato,OU=Named Accounts,OU=User Accounts,OU=Countries,DC=Development,DC=Group,DC=co"
0
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 20117700
You mean without Limit 0 it is showing so many records? and with Limit parameter it is showing only one record?
0
 
LVL 11

Author Comment

by:bsharath
ID: 20117707
With and without "-limit 0"

I just get the object full path as mentioned below...
Only where the user or computer is in which OU...
0
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 20117725
Above query will just show User or Computer CN if it has any field blank.
0
 
LVL 11

Author Comment

by:bsharath
ID: 20117753
Ok got confused sorry. Can you remove the OU path in both...
0
 
LVL 26

Accepted Solution

by:
Farhan Kazi earned 2000 total points
ID: 20117757
For users:

DSQuery * -Filter "(&(sAMAccountType=805306368)(|(!physicalDeliveryOfficeName=*)(!telephoneNumber=*)(!mobile=*)(!title=*)(!Company=*)))"  -Attr samAccountName -Limit 0 >Users.txt

For Computers:

DSQuery * -Filter "(&(objectClass=computer)(|(!location=*)(!description=*)))" -Attr Name -Limit 0 >Computers.txt
0
 
LVL 11

Author Comment

by:bsharath
ID: 20117765
Thanks Farhan.
Any help with the other Q...'s
0
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 20117771
Thanks Sharath, Im looking on your other posts.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question