Solved

disable ad and exchange attributes

Posted on 2014-04-17
2
221 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

22 Experts available now in Live!

Get 1:1 Help Now