One for the AD boffins

Discussion in 'Networks' started by zxspectrum, Dec 8, 2014.

  1. zxspectrum

    zxspectrum Terabyte Poster Forum Leader Gold Member

    2,092
    216
    244
    Ill try and be as concise as I can but here's what I would like to do, with the use of PowerShell if possible. I am not great with Active directory or PowerShell for that matter, but I'm learning as I go etc.

    We have some inactive users some are students and some are staff. Every time someone leaves we have to disable their account, back up their documents and save their email to a PST file then burn all this to a DVD. Now to go through this one by one is very tedious, so this has got me wondering is there a better way.

    Can I write a script to get the contents of a users area and then get the contents of the email account saved to an area where I designate??? I know there will be issues such as the password, I would like this to be as easy as possible. I don't expect anyone to tell me the answer, just some pointers if that is possible.

    Cheers

    Ed
     
    Certifications: BSc computing and information systems
    WIP: 70-680
  2. Sparky
    Highly Decorated Member Award 500 Likes Award

    Sparky Zettabyte Poster Moderator

    10,718
    543
    364
    What domain controller and Exchange versions are you running mate?
     
    Certifications: MSc MCSE MCSA:M MCSA:S MCITP:EA MCTS(x5) MS-900 AZ-900 Security+ Network+ A+
    WIP: Microsoft Certs
  3. zxspectrum

    zxspectrum Terabyte Poster Forum Leader Gold Member

    2,092
    216
    244
    Hey Sparky.

    Hopefully im not being thick here. Server 2008 R2 and exchange 2010

    Cheers
     
    Certifications: BSc computing and information systems
    WIP: 70-680
  4. Shinigami

    Shinigami Megabyte Poster

    896
    40
    84
    It looks like you should be able to script this with a few Powershell cmdlets. With the pipe "|" switch, you could get the user account, disable it, export mail to PST, delete mailbox and user account if needed, and have the PST moved to the PC on which you'll do the burning. Running sufficiently high credentials (easiest of course being Org admin for E2010) is enough to do all this. Running all of it from the Exchange Management Shell (EMS) ensures you have the get mailbox cmdlet available.

    - - - Updated - - -

    Forgot to mention. If their docs are in a share that uses their alias, then it would also be easy to use that for copying them off the file share and to your DVD burning PC. Reason is that the alias is also there for catching the AD account and mailbox as part of the script.

    Yeah, pretty sure you can script this into just a few lines, or go fancy and use a CSV file for input based on multiple usernames.
     
    Certifications: MCSE, MCITP, MCDST, MOS, CIW, Comptia
    WIP: Win7/Lync2010/MCM
    jk2447 likes this.
  5. Sparky
    Highly Decorated Member Award 500 Likes Award

    Sparky Zettabyte Poster Moderator

    10,718
    543
    364
    As said you should be able to do this perhaps from a CSV file and powershell.

    Are wanting to...

    1) Disable account
    2) Export mailbox to pst
    3) Copy users home drive to a directory
    4) Delete account
    5) Repeat depending on how many users
     
    Certifications: MSc MCSE MCSA:M MCSA:S MCITP:EA MCTS(x5) MS-900 AZ-900 Security+ Network+ A+
    WIP: Microsoft Certs
  6. zxspectrum

    zxspectrum Terabyte Poster Forum Leader Gold Member

    2,092
    216
    244
    Hey Guys

    Cheers for the feed back

    Yeah more of less sparky. For some reason the accounts are already disabled or expired.

    Cheers

    Ed
     
    Certifications: BSc computing and information systems
    WIP: 70-680

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.