Snow Drift
asked on
Disable Mailbox Features for Except for Select Group's and OU's
Hello, I am weak in PowerShell and I am cleaning up a messy Exchange 2010 environment. Management wants OWA, IMAP, POP3, and ActiveSync disabled for all users in the domain. However they want one security group of VIP's and another OU with many subfolders to have OWA and ActiveSync enabled. What I have so far would disable the features for all then turn on the features for the select group and OU's. Is there a way to exclude the "ON" users from being disabled in the first place? Thank you.
Disables Features for all mailboxes.
Get-mailbox -OrganizationalUnit "DC=MyCompany,DC=com" | Set-CasMailbox -OWAEnabled $False
Get-mailbox -OrganizationalUnit "DC=MyCompany,DC=com" | Set-CasMailbox -ActiveSyncEnabled $False
Get-mailbox -OrganizationalUnit "DC=MyCompany,DC=com" | Set-CasMailbox -ImapEnabled $False
Get-mailbox -OrganizationalUnit "DC=MyCompany,DC=com" | Set-CasMailbox -PopEnabled $False
Enabled for users in the VipUsers users group.
Get-ADGroup -filter {name -like 'VipUsers'} | Get-ADGroupMember -Recursive | Get-ADUser -Properties MailNickName | select -ExpandProperty MailNickName | Set-CasMailbox -OWAEnabled $true
Get-ADGroup -filter {name -like 'VipUsers'} | Get-ADGroupMember -Recursive | Get-ADUser -Properties MailNickName | select -ExpandProperty MailNickName | Set-CasMailbox -ActiveSyncEnabled $true
Enabled for users in the TravelingUsers OU.
Get-mailbox -OrganizationalUnit "OU=TravelingUsers,OU=User s,DC=MyCom pany,DC=co m" | Set-CasMailbox -OWAEnabled $True
Get-mailbox -OrganizationalUnit "OU=TravelingUsers,OU=User s,DC=MyCom pany,DC=co m" | Set-CasMailbox -ActiveSyncEnabled $True
Disables Features for all mailboxes.
Get-mailbox -OrganizationalUnit "DC=MyCompany,DC=com" | Set-CasMailbox -OWAEnabled $False
Get-mailbox -OrganizationalUnit "DC=MyCompany,DC=com" | Set-CasMailbox -ActiveSyncEnabled $False
Get-mailbox -OrganizationalUnit "DC=MyCompany,DC=com" | Set-CasMailbox -ImapEnabled $False
Get-mailbox -OrganizationalUnit "DC=MyCompany,DC=com" | Set-CasMailbox -PopEnabled $False
Enabled for users in the VipUsers users group.
Get-ADGroup -filter {name -like 'VipUsers'} | Get-ADGroupMember -Recursive | Get-ADUser -Properties MailNickName | select -ExpandProperty MailNickName | Set-CasMailbox -OWAEnabled $true
Get-ADGroup -filter {name -like 'VipUsers'} | Get-ADGroupMember -Recursive | Get-ADUser -Properties MailNickName | select -ExpandProperty MailNickName | Set-CasMailbox -ActiveSyncEnabled $true
Enabled for users in the TravelingUsers OU.
Get-mailbox -OrganizationalUnit "OU=TravelingUsers,OU=User
Get-mailbox -OrganizationalUnit "OU=TravelingUsers,OU=User
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
My pleasure. Have a good one :)
ASKER