[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Find all the users in a OU if the "Hide from Exchange address list" is ticked

Posted on 2007-10-01
11
Medium Priority
?
606 Views
Last Modified: 2008-01-09
Hi,

Find all the users in a OU if the "Hide from Exchange address list" is ticked.

Is there a script that can do this.

Regards
Sharath
0
Comment
Question by:bsharath
  • 6
  • 5
11 Comments
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 19996036
Try this:

Click Start -> Run -> Cmd.exe

DSQuery * "OU Name Here" -Filter "(&(sAMAccountType=805306368)(MSExchHideFromAddressLists=*))" -Attr samAccountName

Example:

DSQuery * "OU=ACCOUNTS,DC=TRAINING,DC=COM" -Filter "(&(sAMAccountType=805306368)(MSExchHideFromAddressLists=*))" -Attr samAccountName

0
 
LVL 11

Author Comment

by:bsharath
ID: 19996776
Hi Farhan...
I ran this script and it got me some names but when i see in ADS they are not checked and they are visible in outlook.
Eevn my name is displayed but i am visible in outlook Gal....
Any help/...
0
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 19996808
Apply following command and post output.

Click Start -> Run -> Cmd.exe

DSQuery * -Filter "(sAMAccountName=BSharath)" -Attr samAccountName MSExchHideFromAddressLists
                                                                    ^ Enter username who have MSExchHideFromAddressLists checked and unchecked.



0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 11

Author Comment

by:bsharath
ID: 19996861
I get this...
C:\>DSQuery * -Filter "(sAMAccountName=Sharathr)" -Attr samAccountName MSExchHid
eFromAddressLists
  samAccountName    MSExchHideFromAddressLists
  SharathR          FALSE

C:\>DSQuery * -Filter "(sAMAccountName=seenua)" -Attr samAccountName MSExchHideF
romAddressLists
  samAccountName    MSExchHideFromAddressLists
  seenua
0
 
LVL 26

Expert Comment

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

DSQuery * "OU Name Here" -Filter "(&(sAMAccountType=805306368)(!MSExchHideFromAddressLists=FALSE))" -Attr samAccountName

Example:

DSQuery * "OU=ACCOUNTS,DC=TRAINING,DC=COM" -Filter "(&(sAMAccountType=805306368)(!MSExchHideFromAddressLists=FALSE))" -Attr samAccountName
0
 
LVL 11

Author Comment

by:bsharath
ID: 19996974
Farhan i get 100's ...Of usernames...But they are not ticked...
0
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 19997005
What about this....

DSQuery * "Optional OU Name Here" -Filter "(&(sAMAccountType=805306368)(MSExchHideFromAddressLists=TRUE))" -Attr samAccountName -Limit 0
0
 
LVL 11

Author Comment

by:bsharath
ID: 19997030
Ok Farhan Got it ...This works...
Any way to scan the whole Domain the same way...
0
 
LVL 26

Accepted Solution

by:
Farhan Kazi earned 2000 total points
ID: 19997053
* To start search from Domain Root

DSQuery * DomainRoot -Filter "(&(sAMAccountType=805306368)(MSExchHideFromAddressLists=TRUE))" -Attr samAccountName -Limit 0


* To start search from Forest Root

DSQuery * ForestRoot -Filter "(&(sAMAccountType=805306368)(MSExchHideFromAddressLists=TRUE))" -Attr samAccountName -Limit 0
0
 
LVL 11

Author Comment

by:bsharath
ID: 19997088
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month17 days, 16 hours left to enroll

831 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