Can you disable an AD account based on the email address

New to Powershell so hopefully this makes sense. I have a script to disable users from a list of user names and it works fine. However our HR system doesn't use the same naming convention as AD.
The only common field is the e-mail address. Does anyone know a script that will search a list of email addresses and disable the associated AD account? The e-mail address from the HR system should be the primary address of the user but it may not always
be so I need to search all the users addresses.
thanks

Hi,
I'd do something along these lines:
Get-Content .\emailList.txt | ForEach {
Get-ADUser -Filter "proxyAddresses -like '*$_*'" | Disable-ADAccount -WhatIf
Remove -WhatIf if you're happy with the initial output to actually disable the accounts.
Braham - note on your method:
Error Message: 'Operator Not supported: -contains' at position: '46'.
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing)

Similar Messages

  • Can you have multiple iTunes accounts associated with one email address?

    My current iTunes account is associated with my company email address that I am attempting to change to my personal email address that I share with my husband.The problem is his iTunes account is also associated with this email address. Is there a way to add my account to our joint email address?

    No. Purchases made on each account are permanently tied to a unique email address and cannot be changed, and accounts cannot be merged. I think you can add an alternate email address for correspondence if/when you can no longer access email at the original address. See HE68: Apple ID: Associating and verifying email addresses with your Apple ID for more information.
    tt2

  • HT4528 Can you disable other notification sounds while on the phone?

    Can you disable other notification sounds while on the phone?

    The only option you have is to put the phone on mute using the side control when you answer the phone.

  • How do u delete iCloud account or CHANGE the email address?

    Long story short, I ended up having to restore to factory settings my iphone.  I had planned on restoring one of the backups that I had done through iTunes.  (Yes, I now know to backup through iCloud so please do NOT suggest that -.-) but it kept telling me that there was a threat detected in the backup file??? So skipped it. And tried again. Didn't work. Got same msg about the threat. So I ended up healing the threat and then it told me that it couldn't restor the backup because a file was either missing or corrupted. I'm like..***!!! Ughness.
    So now I'm trying to set it up so that I can back it up via iCloud so that this stupid issue doens't occur again, but my old @rogers.com email address is the iCloud email addres and I'm trying to change it in the iPhone to my @bell.net email address.  I have changed it in itunes.  It's working there...but my stupid iPhone keeps asking me for the password on the Apple ID that has the @rogers.com email address. THAT IS NOT THE EMAIL ADDRESS THAT IS SET UP IN MY APPLE ID! I have already set up the new one....which is the @bell.net one but for some stupid reason, iCloud keeps wanting the @rogers.com one...and whenever I enter it, it's not correct because that email address has been removed.
    Can someone PLEASE help me.
    Thanks
    Rose

    You can't actually terminate an iCloud account, though obviously you can simply log out of it on all your devices and then ignore it in future.
    I gather that the @icloud.com address is also the actual ID? You can't change that. However if your Apple ID that you use to log into iCloud is a non-Apple email address you can change that - please follow carefully the instructions here:
    http://www.wilmut.webspace.virginmedia.com/notes/icloudfaq2.html#6
    If it's this non-Apple address which is compromised then changing the ID will solve that. If it's the @icloud.com address which is compromised then you cannot change that though you can add up to three 'email aliases' - these are additional addresses (not accounts) which deliver into the same inbox as the main account. (In fact it's a good idea to give out alias addresses, rather than the main address, because if they attract spam you can easily change them.) (New aliases can only be @icloud.com ones; @me.com addresses cannot now be created.)
    You should be aware before you start that once you've created an alias you cannot turn that address into a full iCloud account or move it to another account.
    More information on aliases here: http://help.apple.com/icloud/#mm6b1a490a
    However if you add an alias the original address will still function, so if you are getting a lot of spam it will still arrive.
    You can get a completely new iCloud account simply by creating a new Apple ID at http://appleid.apple.com , for which you will need a new non-Apple address which has never been associated with an Apple ID.
    You will need to sign out of the old account on all your devices and sign in with the new ID.
    If none of this solves the problem and it is a security issue, go to https://getsupport.apple.com ; click 'See all products and services', then 'More Products and Services, then 'Apple ID', then 'Other Apple ID Topics' then 'Apple ID account Security'.

  • HT4897 I have forgotten my original MobileMe account password and the email address that I used to use to retrieve my password no longer works - help!

    I have just upgraded to mountain lion and want to use the icloud. However, years ago I set up a mobile me account and can not remember my password. The email account I set up originally as a default email no longer exists so when I try and set up a new password I am unable to because I can't access the email address I put on file. Can anybody help?

    Are you particularly attached to your ex-MobileMe email address? - it sounds as if you haven't actually used it for very long time. Your easiest option would be to use the ID you have logged in with here to open an iCloud account and choose a new @icloud.com address.
    If you really want to reactivate the MobileMe email address (which is also the ID for that account) you will need to contact Support. Go to https://expresslane.apple.com ; select 'All Products and Services' in the first column, 'More Products and Services' in the second column, then 'Apple ID' in the third column. In the next page select 'Other Apple ID Topics' in the first column then 'Lost or forgotten Apple ID password' and click 'Continue'. You will be offered options to contact Apple by phone.

  • I just used the "find my apple id" and it has an id to my old email address problem is when i try to login to hotmail with that account it says the email address doesn't exist..and this is affecting my application updates and purchases.

    Please help!
    I dont know how the email address doesnt exist and how it can still be an apple id but not let my access my purchases or update old appplications
    thanks,
    Kiah.

    Hey Chris, thanks for your reply.
    The problem is that i have 2 apple Id's now and i used on to purchase my macbook pro a few years back and then i created a new one for my new macbook.. i was trying to update my iphoto and imovie but it kept saying i couldnt update it as it was purchased under a different id, and seeing though i cant get into my old account i cant update what i need to. i know the password for the old one as my brother still uses it but it wont work now as hotmail says the email doesnt exist.
    in saying that i dont think i can get into the old account and change the email address

  • How can i look up my apple id without the email address associated with it

    I do not know the email address associated with my apple id. How can i look up my apple id with out it

    You need an non-Apple email address to set up an Apple ID.
    Yuu can get a Gmail account heee. It is free
    https://support.google.com/mail/answer/56256?hl=en

  • Can you share apps between accounts when using the same PC

    My wife and I have always shared my account. made it easy to purchase and share. Howeever, with iCloud etc its becoming increasingly obvious that seperate accounts might be needed.
    Can you share apps you purchase through differnt accounts when your using the same computer?
    I now you can with music.

    Yes.
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    You can figure out using it with another machine from that too

  • How can you change your Apple ID to a new email address?

    My old email was deleted and I used this as my Apple ID. I now have a new one and can't change my Apple ID on my phone and iPad, (Under 'icloud' in settings). However I have been able to change it in iTunes & App Store.
    I also tried deleting the account and re doing it in my new one but it asks for the password due to find iPhone being on, and it won't do it. (I remember my old password)
    Please help!
    It's very frustrating and keeps wanting me to sign in.
    Thanks

    1) Did you change that old email address to your current email address to be your current Apple ID?  If so, try to enter your current password for your current Apple ID/iCloud account.  If it doesn't work, try #2.
    2) If you don't have access to your old email account.  Same process, go to https://appleid.apple.com and sign in your current iCloud/Apple ID then edit it to your old email address then Save the changes.  DON'T sign out yet.  Go back to your iOS device then delete your iCloud account.  Once deleted, go back to the Apple ID website and rename it back to your current email address.  You have to verify it this time and you will be able to since you have access to that email address.
    3) If your answer to #1 is NO, contact Apple Support (Account Security Team) to help you reset its password but you need to have another email address available which is not yet an Apple ID to send the password reset email.
    Hope this helps!  Cheers!

  • Can you schedule a report to send to a email address that is pulled from a database field?

    Post Author: huber.molly
    CA Forum: Crystal Reports
    Currently, we are collecting email addresses in a database field. We want to send the generated reports to only these email addresses. Is there a way to add a dynamic value to the "To:" field when scheduling a report?
    The goal is to schedule the reports and let them be sent to these addresses so it removes the step of manually entering the addresses.

    Post Author: IdoMillet
    CA Forum: Crystal Reports
    It's not clear what tool you are using to schedule your reports.This may require a 3rd-party tool.  See list of such tools at: http://www.kenhamady.com/bookmarks.html. My Visual CUT software allows you to drag & drop an email field/formula from the report itself into the "Email To" option, to dynamically drive email options by the data in the report.  Alternatively, it allows you to use an SQL Query or a Text file to specify email addresses.- Ido

  • Can you get your IMEI # back based on the phone's serial #?

    My iPhone5 was stolen, and the police won't file a report without the IMEI #. I don't have the packaging anymore, and I never synched the phone with iTunes because my Laptop's OS was incompatible.  I managed to get the phone's serial number through the Apple Store.  Is there a way I can use that to get my IMEI # back?

    Do you still have the original box? All the pertinent information is on the back: IMEI, Serial # etc.

  • Can you have 2 iTunes accounts, and use the same master card?

    I wonderd if I cold have 2 iTunes accounts, one for me, and one for my mom, and use the same master card on both?
    I dont want my mom to **** up my account if she gets an iPhone. Also she would be using my e-mail and my name.

    Yes.

  • Using FormsCentral can you have a response sent to a specific email address based on an answer within the form?

    For example if the respondent chose blue as his favorite color the form response should be sent to Bob. If the respondent answered red, it should go to Susan.

    Sorry we don't support conditional notification. You either get notifications (if you are on this list) or you don't.
    Andrew

  • My number is ***** can you please send me viber code to my email address because my phone is ccurrently not workin.

    I need help with my viber reset? Can the code be sent to my email.
    <Edited by Host>

    You need to contact Viber support for that. This isn't something any of the fellow users here (or Apple for that matter) can help you with.

  • I have accidently created two itunes accounts! and i want to combine them. I've tried to log into one account to change the email address, so maybe the accounts would link, but i cannot log in. any help?

    SO..I have accidently created two itunes accounts. I need to some how combine them. any ideas???

    Sorry... can't be done. Apple says no when it comes to merging accounts.
    Read here > Frequently Asked Questions About Apple ID

Maybe you are looking for

  • HT1595 can i surf the internet on my tv through my apple tv? or is it just for itunes

    IS THE APPLE TV USED TO SURF THE INTERNET?

  • Needed: Power Cord For AC Adapter 90W

    In Brooklyn, NY, where can I get a USA standard power cord for a 90W 20V AC Adapter for a Lenovo T400 ? The connection on the adapter brick looks like two overlapping circles.    I believe it may be what is commonly called the figure 8 connection. So

  • Deleting measures

    I am new to GB and will undoubtedly have many more questions for you pros - I recently brought in a sound loop to a project, and was able to select parts, or measures of the loop and delete them at the bottom of the screen. I would like to do the sam

  • Song credit question

    Hi, I have a credit on my account for 1 song. If I purchase an album (songs are available for individual purchase) will the credit be applied to the overall album price? Any info is appreciated. Thanks

  • Can LR 5.2 be configured to save edits to disk?

    I would really like to be able to save edited photos to disk, i.e., overwrite the original.  I know this is a breach of some universal law, but I would LOVE to be able to make changes in Develop mode in LR, then overwrite the original file on disk.