Solved

disable ad and exchange attributes

Posted on 2014-04-17
2
220 Views
Last Modified: 2014-05-01
Hello Experts

I need some help from your valuable experience and knowledge to write a power shell script to perform following tasks:

Disables the user account in AD
 - Disables OWA/OMA access
 - Queries and blocks connections from any mobile device associated to the user
 - Disables activesync access
 - resets the user password

Our exchange environment is Exchange 2010/2013, AD is a combination of Windows 2008 R2 and 2012 R2 dcs and servers

Looking forward hearing from you
0
Comment
Question by:Jerry Seinfield
2 Comments
 
LVL 14

Expert Comment

by:Justin Yeung
ID: 40007745
Reset password

Set-ADAccountPassword -Identity TheSamAccountName -Reset

Disable OWA

Set-CasMailbox -identity TheSamAccountName -OWAEnabled $False

Disable OMA

Set-CasMailbox -identity TheSamAccountName -ActiveSyncEnabled $False

Disable AD account

Disabled-ADaccount -identity TheSamAccountName

Obtain OWA/ActiveStatus

Get-CasMailbox -identity TheSamAccountName
0
 
LVL 16

Accepted Solution

by:
Enphyniti earned 500 total points
ID: 40009238
I wrote a script that will do this based on user input.  You can grab a copy here:

http://www.experts-exchange.com/Software/Server_Software/Active_Directory/Q_28415019.html

It will block remote devices associated to the user account from connecting to the environment so make sure you do remote device wipes first if you intend to do that.

edit: Attached the file.  Just rename to .ps1 to run it.
superDisable.txt
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now