We help IT Professionals succeed at work.

Reports in many combinations...

bsharath
bsharath asked
on
358 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
Comment
Watch Question

Farhan KaziSystems Engineer
CERTIFIED EXPERT
Top Expert 2007

Commented:
I don't see any 'Extension' or 'Designation' fields in user properties!!

Author

Commented:
Extension is the General Tab > Telephone Number  and Designation is the Title box in Organisation tab
Farhan KaziSystems Engineer
CERTIFIED EXPERT
Top Expert 2007

Commented:
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

Author

Commented:
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....

Author

Commented:
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.

Farhan KaziSystems Engineer
CERTIFIED EXPERT
Top Expert 2007

Commented:
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

Author

Commented:
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"
Farhan KaziSystems Engineer
CERTIFIED EXPERT
Top Expert 2007

Commented:
You mean without Limit 0 it is showing so many records? and with Limit parameter it is showing only one record?

Author

Commented:
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...
Farhan KaziSystems Engineer
CERTIFIED EXPERT
Top Expert 2007

Commented:
Above query will just show User or Computer CN if it has any field blank.

Author

Commented:
Ok got confused sorry. Can you remove the OU path in both...
Systems Engineer
CERTIFIED EXPERT
Top Expert 2007
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks Farhan.
Any help with the other Q...'s
Farhan KaziSystems Engineer
CERTIFIED EXPERT
Top Expert 2007

Commented:
Thanks Sharath, Im looking on your other posts.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.