WSUS Clean up Query
http://www.argyletech.com/t/wsus-cleanup.txt
USE SUSDB
DECLARE @var1 INT, @curitem INT, @totaltodelete INT
DECLARE @msg nvarchar(200)
CREATE TABLE #results (Col1 INT) INSERT INTO #results(Col1)
EXEC spGetObsoleteUpdatesToCleanup
SET @totaltodelete = (SELECT COUNT(*) FROM #results)
SELECT @curitem=1
DECLARE WC Cursor FOR SELECT Col1 FROM #results
OPEN WC
FETCH NEXT FROM WC INTO @var1 WHILE (@@FETCH_STATUS > -1)
BEGIN SET @msg = cast(@curitem as varchar(5)) + ‘/’ + cast(@totaltodelete as varchar(5)) + ‘: Deleting ‘ + CONVERT(varchar(10), @var1) + ‘ ‘ + cast(getdate() as varchar(30))
RAISERROR(@msg,0,1) WITH NOWAIT
EXEC spDeleteUpdate @localUpdateID=@var1
SET @curitem = @curitem +1
FETCH NEXT FROM WC INTO @var1
END
CLOSE WC
DEALLOCATE WC
DROP TABLE #results
Office 365 Email Retention Issues after PST upload/import
Set-Mailbox -identity [*** Email address is removed for privacy ***] -RetentionHoldEnabled $false
Start-ManagedFolderAssistant -Identity “Chris”
Start-ManagedFolderAssistant
Use the Start-ManagedFolderAssistant cmdlet to immediately start messaging records management (MRM) processing of mailboxes that you specify.
Start-ManagedFolderAssistant -Identity “Chris”
Getting Outlook to Autodiscover Office 365
http://www.mcbsys.com/blog/2011/08/using-office-365-in-an-sbs-2008-environment-take-2/
get-clientaccessserver | set-clientaccessserver –autodiscoverserviceinternaluri "https://autodiscover.outlook.com/Autodiscover/Autodiscover.xml"
Getting Outlook to Autodiscover Office 365
While editing the Service Connection Point in Active Directory Sites and Services does work, it’s probably not the “approved” way to do things.
The support manager recommended that I instead use the Exchange Management Shell to entirely remove the Autodiscover Virtual Directory using Remove-AutodiscoverVirtualDirectory. Here’s how I did that:
1. Open an elevated command prompt and back up the IIS configuration (explained here):
%windir%\system32\inetsrv\appcmd.exe add backup "Before Removing Autodiscover"
2. Open an elevated Exchange Management Shell and retrieve the current autodiscover virtual directory:
Get-AutodiscoverVirtualDirectory | fl Name, Server, InternalUrl, ExternalUrl, Identity
Save the results to a text file in case you need them to re-set the virtual directory later (see Schyler Jones’ comment below on December 2, 2015). Copy the Identity value to the clipboard.
3. In the Exchange Management Shell, remove the autodiscover virtual directory:
Remove-AutodiscoverVirtualDirectory –Identity "<identity value retrieved above>"
You will have to confirm by typing a “Y”.
4. Check that the autodiscover virtual directory is gone:
Get-AutodiscoverVirtualDirectory | fl Name, Server, InternalUrl, Identity
This should now return nothing.
5. Now, with Outlook running on a desktop, hold the Ctrl button, right-click on the Outlook icon in the system tray, and select Test E-mail AutoConfiguration. Enter your email address and password and click the Test button. The results should come from the Office 365 server.
Disable Clutter for all
Get-mailbox -ResultSize Unlimited | Set-Clutter -Enable $false
RD Gateway issues with SBS
Fix SSL bindings:
REG ADD HKLM\SYSTEM\CurrentControlSet\services\HTTP\Parameters\SslBindingInfo\0.0.0.0:443 /v DefaultFlags /t REG_DWORD /d 1 /f
net stop tsgateway & net start tsgateway
Remove crap apps from default Windows 10 install
reg add HKLM\Software\Policies\Microsoft\Windows\CloudContent /v DisableWindowsConsumerFeatures /t REG_DWORD /d 1 /f
Delete all O365 mailbox contents
Search-Mailbox -Identity “JohnDoe_Admin” -DeleteContent
New-ManagementRoleAssignment -Role “Mailbox Import Export” -User “JohnDoe_Admin”
Getting Outlook to Autodiscover Office 365
http://www.mcbsys.com/blog/2011/08/using-office-365-in-an-sbs-2008-environment-take-2/
While editing the Service Connection Point in Active Directory Sites and Services does work, it’s probably not the “approved” way to do things.
The support manager recommended that I instead use the Exchange Management Shell to entirely remove the Autodiscover Virtual Directory using Remove-AutodiscoverVirtualDirectory. Here’s how I did that:
1. Open an elevated command prompt and back up the IIS configuration (explained here):
%windir%\system32\inetsrv\appcmd.exe add backup "Before Removing Autodiscover"
2. Open an elevated Exchange Management Shell and retrieve the current autodiscover virtual directory:
Get-AutodiscoverVirtualDirectory | fl Name, Server, InternalUrl, ExternalUrl, Identity
Save the results to a text file in case you need them to re-set the virtual directory later (see Schyler Jones’ comment below on December 2, 2015). Copy the Identity value to the clipboard.
3. In the Exchange Management Shell, remove the autodiscover virtual directory:
Remove-AutodiscoverVirtualDirectory –Identity "<identity value retrieved above>"
You will have to confirm by typing a “Y”.
4. Check that the autodiscover virtual directory is gone:
Get-AutodiscoverVirtualDirectory | fl Name, Server, InternalUrl, Identity
This should now return nothing.
5. Now, with Outlook running on a desktop, hold the Ctrl button, right-click on the Outlook icon in the system tray, and select Test E-mail AutoConfiguration. Enter your email address and password and click the Test button. The results should come from the Office 365 server.