Link to home
Start Free TrialLog in
Avatar of Jerry Seinfield
Jerry SeinfieldFlag for United States of America

asked on

disable ad and exchange attributes

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
Avatar of Justin Yeung
Justin Yeung
Flag of United States of America image

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
ASKER CERTIFIED SOLUTION
Avatar of Jon Brelie
Jon Brelie
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial