Settin a variable using Get-Mailuser. Need to exclude accounts with a warning.

Working on a project where we needed to automated the mail-enabling of mailusers.  I also need to create a csv file after the fact that kicks out those new mail enabled objects with their LegacyExchangeDN value.
So I setup this query to get all the valid mailusers that need to be mailenabled.  Valid meaning they have the targetaddress attribute set.  Need to be mail enabled because they do not have a legacyexchangedn value.
This works except for one issue.  Some of the accounts have a leading or trailing whitespace in their display name.  That is being addressed.  But in the meantime I need to put some code together that detects the error state and doesn't include
those users in the $users variable.  So I can later use that variable to create the csv file.  Thoughts?
$users = Get-mailuser -ResultSize unlimited -OrganizationalUnit "domain.COM/Accounts/Users" ` -Filter {ExternalEmailAddress -ne $null} | ?{$_.legacyexchangeDN -eq ""}
Jeff C

Why don't you just fix the display names first? It's such an easy fix.
If you can't wait or fix it first, you might try something like this.
$users = Get-mailuser -ResultSize unlimited -OrganizationalUnit "domain.COM/Accounts/Users" `
-Filter {ExternalEmailAddress -ne $null} | `
Where {(($_.DisplayName -NotLike "* ") -and ($_.DisplayName -NotLike " *"))} | `
?{$_.legacyexchangeDN -eq ""}
Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

Similar Messages

  • How to get result of MDM validation expression with type warning?

    I need  to get result of MDM validation expression with type WARNING (in automatic execution),
    but - method validationResult.getFailedValidations(..) returns validation if it has type ERROR,
    so all Warnings treated only as success despite it returned false or true.
    My question - how can I get that 'false or true' expression resut for validation.
    thanks

    Hello Vladimir
    By my opinion, hook warning exception isn't make sense because after warning message data will be change(upload).
    Moreover  if you start validation from WF Warning exception doesn't work at all.
    If you want to do some data changes you should use and hook Error exception.
    Regards
    Kanstantsin Chernichenka

  • I used to share one apple ID/account with my ex but made a new one for myself recently and logged out of the old one but when I try to update my iBooks it asks for the old account's password(which my ex changed by now)

    I used to share one apple ID/account with my ex but made a new one for myself recently and logged out of the old one but when I try to update my iBooks (only happens with this app)it asks for the other account's password(which my ex changed by now). I don't understand why this happens when I'm logged into my account and it only happens with that app. Please help, I need to update. :/

    Content (apps, music, ibooks, films etc) is tied to the account that originally downloaded it, so if the iBooks app was downloaded using the account that you used to share with your ex then only that account can download updates to it. As it's a free app you could delete it and re-download it under your own account - and then re-download your ibooks into it (or copy the books to your computer's iTunes first via File > Transfer Purchases and then sync them back to the app).

  • Hi, I use two email addresses within one account with gmx.  I created one account with the first email address now. How do I add the second one to this account? Now it looks like this. One account was opened with address A. I receive in this account email

    Hi, I use two email addresses within one account with gmx.
    I created one account with the first email address now. How do I add the second one to this account?
    Now it looks like this.
    One account was opened with address A.
    I receive in this account emails for address A and B.
    But I can only write and answer with address A.

    Hi Rudegar,
    Sorry for my late reply.
    It s not the amount of accounts I'm struggling with.
    When I create now for both email addresses one account, then I receive the same emails two times.
    That is not what I want.
    Because on gmx the two email addresses have the same inbox and outbox.
    E.g. I can login to my gmx account either with email A or B. It doesn't matter.
    Now I want to have the same on my ipad.
    One account with both email addresses.

  • How to Use COLUMN NOPRINT - need to exclude one column from Select *

    Dear Friends,
    I need to exclude one column from a SELECT * query. Everytime the column data type is BLOB, I dont' want it to be part of my SELECT. After googling I found some info about NOPRINT but it doesn't seem to be working in my case. May be I am using it incorreclty.
    COLUMN FILE_DESC NOPRINT
    SELECT * FROM FILES;
    Where FILE_DESC is of BLOB datatype.Can I use it in my SELECT or it has to be used in Dynamic SQL? Is there any other option to achieve this?
    Thanks in advance.

    Hi,
    COLUMN FILE_DESC NOPRINT
    affects all queries in the same SQL*Plus session (unless you cancel it with a COLUMN FILE_DESC PRINT command.)  It doesn't matter if those queries are static or dynamic.  As mentioned before, COLUMN is a SQL*Plus command.  If you using a different front end, then it may have a different way to hide specific output columns.
    Did you have a poroblem when you tried it?  Post a complete test script that the people who want to help you can use to re-create the problem and test their ideas.
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Do I need to have my site uploaded to a remote host for embeded formscentral form  to work? I am getting a broken section of header with a warning sign on top corner saying "!Local host." Cheers

    Hey there all.
    I am wondering if there is something wrong with my embedded form or if it is simply because
    I have not uploaded my site to remote host yet? I am only getting a broken part of the header with
    no actual form, with a warning "!local host" in top left hand corner. If anyone could enlighten
    me on this problem it would be greatly appreciated, it is my first time making forms

    Cheers, I noticed some browsers were treating the form differently. I am uploading to a test server tomorrow, hopefully all goes well, thanks for your reply  

  • Locked out with file vault. Did fix by setting up new user account but cannot access old account with files                           but I can't get back into my old account with all my doc's and pics

    I was locked out by File Vault. I set up a new account by fooling the notebook it was a new start up. Now I cannot access my old account with all of my files. I can see it in Accounts but it will not let me access. Help

    I managed to get a few Time Machine Back Ups  before I passed away
    I'm not sure whether a ghost can do this, but if you were still alive, you could do as follows.
    First make sure you have read & write access to the folder you're trying to restore to. You should be able to see its contents in the Finder, and to move files in and out of it.
    This is an exception to the rule that you should never make any changes to backup data. I've tested this procedure in OS X 10.8 only. It should work with later versions, but I don't know whether it works in earlier versions. Use it only for files that were backed up from your home folder, or a folder on another volume created by you, and would normally be writable by you. Do not touch backups of system or application files.
    In the Finder (not in the time-travel view), navigate to the backup volume, then to the folder named "Backups.backupdb", and then to the snapshot you want to restore from. The snapshots are folders labeled with the date when they were created. Inside each of those folders is a file hierarchy like the one on the volume that was backed up. Descend through the hierarchy until you come to a folder named "Users," and inside that, a folder with your user name. The procedure will be different if you're trying to restore files on another volume.
    Select the folder and open the Info dialog (command-I). Click the padlock icon in the lower right corner of the window and authenticate. In the Sharing & Permissions section, give your account Read & Write access. You may have to close the dialog and repeat this step in order for the change to show up. Then click the gear icon and select
              Apply to Enclosed Items
    from the popup menu.
    Try the restore operation again, in the time-travel interface.

  • Using Business Area and Profit Center Accounting with New GL functionality

    Hello,
    We are Public Sector and using ECC 6.0, we have been using Business Area with Fund Management. We also use Special Purpose Ledger with Document splitting. Before migrating to New GL functionality, we want to understand
    -     The possibility of using both Business Area and Profit Center Accounting, and the impact on the system
    -     If we activate Profit Center Accounting before migration, how will it work with the splitting process?
    -     If we migrate without Profit Center Accounting, will this cause the activation of Profit center accounting later to be more complicated, even if we migrate again?
    Thanking you

    Hi Sachin,
    Thank you for the reply, we want to know that
    -     The possibility of using both Business Area and Profit Center Accounting, and the impact on the system
    If we decide using Profit Center Accounting with Business Area with New GL functionality how we should do it
    -     should we activate classical Profit Center Accounting before migrating to New GL functionality, if we do this how will it work with the splitting process?
    -     If we migrate to New GL functionality without Profit Center Accounting, will this cause the activation of Profit center accounting later to be more complicated, even if we migrate again?
    Thanking you
    Tipu Khan

  • I have an iPhone and i used to be on a joined account with my mom.  I am now trying to get on to my own account but i want to keep the music and apps that have already downloaded with my mom's account.  How can i do this?

    Hi my name is Scott,
    I'm trying to get my old information (apps, music) from my iphone that was previously on a different account to sync on a new account.  I just got a new macbook pro and got a new account to go with it.  Now i have tried to homeshare the accounts and drag the music over to download it onto this new account but i can't get the homesharing to work because it says the password doesn't match even though i have used the same one to log on and off of homesharing on my mom's account.  I have recently tried to back up my phone onto this new account and it asks if i want to authorize it and asks for the password for my mom's account.  I have the password but i am hesitant to authorize it with my mom's apple ID and password because i don't want her account to be on this computer.  I want it to be my own account just with my personal music from my iphone on it.  I dont know if it will just sync my iphone's information to my new account or just add my mom's apple ID account to my itunes on my computer.  What should i do to get my information from my iphone from my mom's account onto my new account? Thank you

    That number is for an apple server in the UK that is used for iMessage activation.  A hidden SMS is snet to that number when you turn iMessage on and is used to verify your phone number.  I suggest you turn iMessage off.  In settings/phone turn on dial assist.  Check with your carrier to see if you can send an international SMS as you end that possibility to activate iMessage.  Rest your phone (Hold down the Sleep/Wake button and the home button together until the apple logo appears (ignore the ON/OFF slider) then let both buttons go and wait for device to restart (no data will be lost).) then turn iMessage back on.

  • Have to use GET LINK feature to open pics with BB8330

    Can anyone help with this? Purchased 2 new BB8330 curve through best buy (sprint is the carrier) at the same time, one for me and the wife. She gets her MMS pics right away, I have to use the link to go and view the picture. Called help desk from sprint, no help. Wiped the phone, reloaded service books, still the same result. ITs soooooo annoying, any help for a newbee to the forum?
    I am running version 4.5.0.131
    P.S.- i can send MMS no problem,but when receiving i just get a message, "you have new picture mail" and have to click on a link to open it. it works and i can see the pic once i download the link but its a pain. She can just open her message and the pic is on the screen without using a link.

    open messeges icon, click menu and options
    make sure enable HTML is yes, and download images is yes

  • Does ipad2 need separate sim account with telstra in Australia

    Wondering if I need to get a sim card (with a separate account or the same one) or use the personal hotspot on the iphone 4

    If you have the ATT type 3G iPad with the removable micro-sim, you can either get the microsim or tether the iPad with the iPhone 4, as long as the iPhone has the newer iOS installed and you have your data service upgraded to tethering.

  • Get ichat contacts to another account with mobileme expired

    hey everyone
    i had bought a mobileme account a year ago and they finally sent me a message saying that my account was closed. i was using ichat then it freezed. i try logging back in then it says that my password is wrong. i did a little research and found out that apple cancels the ichat account when mobile me ends. so i wanted to know if there is a way of getting my contacts off my mobileme ichat account and putting them on my new updated AIM account.

    No.
    The Buddy List itself is held on the AIM servers (Even for Apple IDs)
    The AIM servers check the Apple Servers to validate any ID
    Therefore you cannot access that Buddy List
    If on the other hand you added the Real names to the Buddies info they are stored in the Address Book.
    You can drag names from the Address Book to your New Buddy List.
    This way you will get all but the ones you had with Screen Names only.
    10:35 PM Tuesday; May 5, 2009
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"

  • Using two iPods on two XP accounts with the same music

    I can't find an answer to this exact question in the forum. We have two iPods and a Windows XP account each. I set up two iTunes accounts for the iPod as instructed, using a shared music folder on the Documents and Settings/All Users/Shared documents folder. This appeared to work quite well. However I continued to load a lot of CDs onto one of the accounts, but although the shared iTunes music folder seems to have all the CDs loaded in it (and the second iTunes account points to the correct folder), the second iTunes account doesn't access that music loaded after I set up the two accounts. Can anyone tell me how to sort this out?
    Dell Dimension Windows XP
    Dell Dimension   Windows XP  

    iTunes does not automatically add files to library like you are looking for. The user that did not add the files has to do a file or folder import to get the tracks into that library.
    This is the one feature I really want added. I have already put in the suggestion.

  • Can I use purchase credits from my iTunes account with ATV?

    I have some credit from an iTunes Gift card on my account. If I purchase movies and TV shows on ATV (which is logged into my account), will it charge my credit card with use the credits?
    Thanks!

    Michele, are you saying this from personal experience. It's been some time since I had any credits on my account (usually just after Christmas when everyone swaps there gift cards for cash with me) but when I did, content purchased on the tv will always debit my credit card, whereas purchases made from itunes on my mac will use up the credit balance before debiting my credit card.

  • Get password to old itunes account with defunct email?

    At one time I had two accounts under which I bought music, not knowing any better. Now on my new computer there are a bunch of songs I can't download to my iPhone because the computer is not "authorized" for those. I have forgotten the password and the email address is long gone. How can I get those back?
    Thank you!

    Recover media from iPod
    See this post for options on moving your iPod data back to your computer.
    tt2

Maybe you are looking for