+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
Scripts Thread, Poweshell query help in Coding and Web Development; Hi, Using the Quest cmdlets for powershell i would like to query users who have the attribute msExchHideFromAddressLists a "not ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,045
    Thank Post
    888
    Thanked 1,727 Times in 1,490 Posts
    Blog Entries
    12
    Rep Power
    453

    Poweshell query help

    Hi,

    Using the Quest cmdlets for powershell i would like to query users who have the attribute msExchHideFromAddressLists a "not set"

    I use this code the find the users who have the option as true and it works.

    Code:
    get-aqduser - ldapfilter '(msExchHideFromAddressLists=TURE)
    this doesnt work for not set

    Code:
    get-aqduser - ldapfilter '(msExchHideFromAddressLists=not set)
    Does anyone know what i would need to put please?

    Thanks

  2. #2
    DT2
    DT2 is offline
    DT2's Avatar
    Join Date
    May 2011
    Location
    Lakeville, Carleton County, New Brunswick
    Posts
    695
    Thank Post
    140
    Thanked 197 Times in 138 Posts
    Rep Power
    74
    tried FALSE?

    How's sunny Oz? Missing Rochdale much??

    DT

  3. #3

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,045
    Thank Post
    888
    Thanked 1,727 Times in 1,490 Posts
    Blog Entries
    12
    Rep Power
    453
    Im back in Rochdale

    False is a thrid option that can be set so wont work

  4. #4
    DT2
    DT2 is offline
    DT2's Avatar
    Join Date
    May 2011
    Location
    Lakeville, Carleton County, New Brunswick
    Posts
    695
    Thank Post
    140
    Thanked 197 Times in 138 Posts
    Rep Power
    74
    EDIT: <Not set> is a Null value - use * instead. Notes are always handy

    Oh, sorry to hear that you heading back out to Oz? I'm migrating to Canada in a few weeks, another Rochdalian fleeing to better climes
    Last edited by DT2; 28th May 2012 at 02:32 PM.

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,045
    Thank Post
    888
    Thanked 1,727 Times in 1,490 Posts
    Blog Entries
    12
    Rep Power
    453
    Quote Originally Posted by DT2 View Post
    I was under the impression that this was a boolean value...

    Oh, sorry to hear that you heading back out to Oz? I'm migrating to Canada in a few weeks, another Rochdalian fleeing to better climes
    I couldnt get a visa so im here for now

  6. #6
    DT2
    DT2 is offline
    DT2's Avatar
    Join Date
    May 2011
    Location
    Lakeville, Carleton County, New Brunswick
    Posts
    695
    Thank Post
    140
    Thanked 197 Times in 138 Posts
    Rep Power
    74
    That's a poor do mate, sorry to hear that.
    I had some family move out there, and they had a hard time of it with visas and jobs getting pulled from under them.
    Canada is so much easier, it has to be said.

    Darren
    Last edited by DT2; 28th May 2012 at 02:37 PM.

  7. #7

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,697
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by FN-GM View Post
    Im back in Rochdale

    False is a thrid option that can be set so wont work
    Not exactly "pretty", but can't you do it like this:

    Code:
    (&(msExchHideFromAddressLists<>TRUE)(msExchHideFromAddressLists<>FALSE))
    So it should only accept those who aren't true or false, aka "3rd option"

    Steve

  8. #8

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,045
    Thank Post
    888
    Thanked 1,727 Times in 1,490 Posts
    Blog Entries
    12
    Rep Power
    453
    Quote Originally Posted by Steve21 View Post
    Not exactly "pretty", but can't you do it like this:

    Code:
    (&(msExchHideFromAddressLists<>TRUE)(msExchHideFromAddressLists<>FALSE))
    So it should only accept those who aren't true or false, aka "3rd option"

    Steve
    invalid filter error

  9. #9
    DT2
    DT2 is offline
    DT2's Avatar
    Join Date
    May 2011
    Location
    Lakeville, Carleton County, New Brunswick
    Posts
    695
    Thank Post
    140
    Thanked 197 Times in 138 Posts
    Rep Power
    74
    Apologies, with my edit it's probably been over looked: <Not set> is a Null value - use * instead.

    DT

  10. #10

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,045
    Thank Post
    888
    Thanked 1,727 Times in 1,490 Posts
    Blog Entries
    12
    Rep Power
    453
    Quote Originally Posted by DT2 View Post
    Apologies, with my edit it's probably been over looked: <Not set> is a Null value - use * instead.

    DT
    That gives the same results asif true was being used.

  11. #11
    DT2
    DT2 is offline
    DT2's Avatar
    Join Date
    May 2011
    Location
    Lakeville, Carleton County, New Brunswick
    Posts
    695
    Thank Post
    140
    Thanked 197 Times in 138 Posts
    Rep Power
    74
    hmm.... what version of exchange are you running?

  12. #12

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,045
    Thank Post
    888
    Thanked 1,727 Times in 1,490 Posts
    Blog Entries
    12
    Rep Power
    453
    2010, isnt a * a wild card?

  13. #13
    DT2
    DT2 is offline
    DT2's Avatar
    Join Date
    May 2011
    Location
    Lakeville, Carleton County, New Brunswick
    Posts
    695
    Thank Post
    140
    Thanked 197 Times in 138 Posts
    Rep Power
    74
    it's used to search for null values, <not set> being that.

    (!msExchHideFromAddressLists=*)

    the ldap filter to find null values is by negating ('!' is the equiv of 'not') a value of anything (e.g. '*')

    Perhaps should read my notes fully and thoroughly

  14. Thanks to DT2 from:

    FN-GM (28th May 2012)

  15. #14

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,045
    Thank Post
    888
    Thanked 1,727 Times in 1,490 Posts
    Blog Entries
    12
    Rep Power
    453
    It errors out. Please see the attached.

    Thanks
    Attached Images Attached Images

  16. #15
    DT2
    DT2 is offline
    DT2's Avatar
    Join Date
    May 2011
    Location
    Lakeville, Carleton County, New Brunswick
    Posts
    695
    Thank Post
    140
    Thanked 197 Times in 138 Posts
    Rep Power
    74
    Failing that, try having a look at powergui.org, that's where some of my powershell notes are compiled from. Some very useful info there.

    DT

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. SCCM Collection Query Help
    By deano in forum Enterprise Software
    Replies: 0
    Last Post: 18th May 2012, 04:24 PM
  2. Script Help - Query AD and add it to a reg key
    By Stuart_C in forum Scripts
    Replies: 6
    Last Post: 14th May 2010, 06:04 PM
  3. [MS Office - 2007] MS Access query help
    By randle in forum Office Software
    Replies: 7
    Last Post: 9th November 2009, 01:17 PM
  4. Help With SQL Query Error
    By penfold_99 in forum Coding
    Replies: 6
    Last Post: 15th May 2009, 01:30 PM
  5. EZ_GPO usage and helpfulness query
    By tarquel in forum Windows
    Replies: 6
    Last Post: 21st June 2005, 02:00 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •