Link to home
Start Free TrialLog in
Avatar of bsharath
bsharathFlag for India

asked on

Reports in many combinations...

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
Avatar of Farhan Kazi
Farhan Kazi
Flag of Australia image

I don't see any 'Extension' or 'Designation' fields in user properties!!
Avatar of bsharath

ASKER

Extension is the General Tab > Telephone Number  and Designation is the Title box in Organisation tab
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

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

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
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"
You mean without Limit 0 it is showing so many records? and with Limit parameter it is showing only one record?
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...
Above query will just show User or Computer CN if it has any field blank.
Ok got confused sorry. Can you remove the OU path in both...
ASKER CERTIFIED SOLUTION
Avatar of Farhan Kazi
Farhan Kazi
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Farhan.
Any help with the other Q...'s
Thanks Sharath, Im looking on your other posts.