Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

disable ad and exchange attributes

Posted on 2014-04-17
2
Medium Priority
?
229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:
Jon Brelie earned 2000 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

Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

Question has a verified solution.

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

In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

597 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