locked
Script that can move expired accounts from one OU to another OU RRS feed

  • Question

  • 1.) I don't know if this is possible but I need a script to move only 'Expired' accounts from one OU (2008 R2) to another OU. I have a script that does this for 'Disabled' accounts but lack the knowledge to tweak it for 'Expired' accounts.

    2.) There is nothing in the script repository for this and I already made a request for one to be made.

    3.) I am not a "scripting guy" hence my reason for posting here...So lets avoid any dumb comments

    If anyone has a script or knows where I can find one that can do this for me it would be much appreciated. Thanks!

    -Moss

    Monday, January 14, 2013 8:57 PM

Answers

  • 10  seconds with a search engine yields the answer and it is still free:

    http://blogs.technet.com/b/heyscriptingguy/archive/2006/01/04/how-can-i-move-all-the-users-from-one-ou-to-another-ou.aspx

    Just add the expired filter into the search and you are set.


    ¯\_(ツ)_/¯

    I am not surprised to be getting actual attempts at help from you JRV. You alone have helped me solve many issues. I found this as well earlier but it seems it is just to move accounts. I need to move only expired accounts if that is even possible which I do not know. The answer has to be out there somewhere. Thanks!

    -Moss


    Yes- just add the expired filter into the results.

    ¯\_(ツ)_/¯

    • Marked as answer by Maurice Moss Monday, January 14, 2013 11:09 PM
    Monday, January 14, 2013 11:01 PM

All replies

  • Hi,

    Everybody starts somewhere. This forum generally isn't the place to ask others to make coding changes for you, as that's essentially tantamount to free consulting work. The main reason for this is that while we can suggest a change, if you don't understand what the code does, you won't understand whether the code change does what is needed or not.

    Bill

    Monday, January 14, 2013 9:04 PM
  • I am not asking for anyone to make "changes" to anything. I am asking if anyone has a script that can do this...much like the "FREE" script repository...
    Monday, January 14, 2013 9:17 PM

  • Why are you on here...First of all you are saying I said things I didn't then saying its essentially free consulting work...Yea...just about all the posts on these forums can be considered "Free" consulting...If your not here to help...Why are you here?
    Monday, January 14, 2013 9:25 PM
  • Hi,

    I did not intend any offense, but please understand that the people answering questions in this forum are busy professionals, most with full-time jobs, who volunteer to answer questions here.

    This forum is to help script writers get their scripting questions answered. In general (depending on your requirements, of course), you're probably not going to find a script that does exactly what you want, so you're probably going to have to write one to do what you need. If you get stuck writing your script, this is the place to ask for help with it.

    Bill

    Monday, January 14, 2013 9:38 PM
  • I guess I just missed the banner that said only people that can script with expert knowledge can post here. I'll just have to keep my novice level of scripting to myself.  Don't worry though ill avoid this website for any scripting questions since this is the only forum for it. Maybe the guys at the script repository will answer my request for the script...Since they actually have a section where you can request a script be made without asking for payment...Either way...Thanks for making me realize how "useful" this forum is.
    • Marked as answer by Maurice Moss Monday, January 14, 2013 9:50 PM
    • Unmarked as answer by Maurice Moss Monday, January 14, 2013 10:29 PM
    Monday, January 14, 2013 9:50 PM
  • Hi,

    This probably didn't occur to you, but you didn't post any code or demonstrate any willingness to contribute to your own solution. You're free to wait for others to write a script for you, or you can roll up your sleeves and start pursuing the learning that will enable you to write your own scripts (or at least, get started in the right direction). We're here to answer your questions whenever you decide to start.

    Bill

    Monday, January 14, 2013 9:57 PM
  • 10  seconds with a search engine yields the answer and it is still free:

    http://blogs.technet.com/b/heyscriptingguy/archive/2006/01/04/how-can-i-move-all-the-users-from-one-ou-to-another-ou.aspx

    Just add the expired filter into the search and you are set.


    ¯\_(ツ)_/¯

    • Proposed as answer by Naomi N Monday, February 11, 2013 6:04 PM
    Monday, January 14, 2013 10:16 PM
  • Are you high?

    You just said earlier that this isn't the place to get help with code changes (for some reason) and that if I did it would be free consulting...Now your saying I didn't make an effort because I didn't post any code...Do you read what your typing before you post...All I wanted was help if someone knew of a script like this. If you don't have anything constructive to say...Don't say anything...I have a small amount of knowledge in Powershell but not enough to write this script as I am still learning. I support 500+ users in a two-man shop running 2008 R2. The two of us run EVERYTHING from account creations to everything on the servers. That leaves little time for scripting unfortunately. I was reaching out to this forum for help in an effort to further my knowledge...not criticism...


    Either way...I'm done...Its been made quite clear that this is the wrong place to look for help unless you have an expert knowledge on the subject.
    • Edited by Maurice Moss Monday, January 14, 2013 10:29 PM
    • Marked as answer by Maurice Moss Monday, January 14, 2013 10:29 PM
    • Unmarked as answer by Maurice Moss Monday, January 14, 2013 11:09 PM
    Monday, January 14, 2013 10:28 PM
  • Hi,

    Expert knowledge is not needed. We all start somewhere. If you have a scripting question (rather than a "someone write a script for me" or "change this script so it does exactly what I want" request), feel free to post the code you have a question about, what problem you are having (error messages, etc.), and we'll be happy to try to answer it.

    Bill

    Monday, January 14, 2013 10:32 PM
  • 10  seconds with a search engine yields the answer and it is still free:

    http://blogs.technet.com/b/heyscriptingguy/archive/2006/01/04/how-can-i-move-all-the-users-from-one-ou-to-another-ou.aspx

    Just add the expired filter into the search and you are set.


    ¯\_(ツ)_/¯

    I am not surprised to be getting actual attempts at help from you JRV. You alone have helped me solve many issues. I found this as well earlier but it seems it is just to move accounts. I need to move only expired accounts if that is even possible which I do not know. The answer has to be out there somewhere. Thanks!

    -Moss

    Monday, January 14, 2013 10:48 PM
  • 10  seconds with a search engine yields the answer and it is still free:

    http://blogs.technet.com/b/heyscriptingguy/archive/2006/01/04/how-can-i-move-all-the-users-from-one-ou-to-another-ou.aspx

    Just add the expired filter into the search and you are set.


    ¯\_(ツ)_/¯

    I am not surprised to be getting actual attempts at help from you JRV. You alone have helped me solve many issues. I found this as well earlier but it seems it is just to move accounts. I need to move only expired accounts if that is even possible which I do not know. The answer has to be out there somewhere. Thanks!

    -Moss


    Yes- just add the expired filter into the results.

    ¯\_(ツ)_/¯

    • Marked as answer by Maurice Moss Monday, January 14, 2013 11:09 PM
    Monday, January 14, 2013 11:01 PM
  • Oh lol...I read that thinking something differently the first time you said it. Thanks!

    -Moss

    Monday, January 14, 2013 11:08 PM
  • Here are the basics of getting and using the date.

    http://powershelleverydayfaq.blogspot.com/2010/04/how-to-get-and-set-accountexpires.html


    ¯\_(ツ)_/¯

    Monday, January 14, 2013 11:16 PM