Solved

disable ad and exchange attributes

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

This script checks a path to see if a folder exists. If the folder does exist you will get output "The folder has previously been created. No action taken" If not it will create the folder. Then adds one user modify permission to the folder. It …
A brief introduction to what I consider to be the best editor for PowerShell.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

825 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