Skip to content

Tag «script»

How to disable automapping Exchange 2010 for all mailbox

With exchange 2010 post SP1, there’s a new feature that cause lots of problem: AUTOMAPPING With the below script you can disable all automapped mailbox   # Get all mailboxes in the forest $Mailboxes = Get-Mailbox -ResultSize unlimited -IgnoreDefaultScope -OrganizationalUnit Other $ConfirmPreference = ‘None’ # Iterate over each mailbox foreach($Mailbox in $Mailboxes) { try { …

How to kill all connections to a SQL Server DB

Script to accomplish this, replace ‘DB_NAME’ with the database to kill all connections to: USE master GO SET NOCOUNT ON DECLARE @DBName varchar(50) DECLARE @spidstr varchar(8000) DECLARE @ConnKilled smallint SET @ConnKilled=0 SET @spidstr = ” Set @DBName = ‘DB_NAME’ IF db_id(@DBName) < 4 BEGIN PRINT ‘Connections to system databases cannot be killed’ RETURN END SELECT …