You may notice that all of a sudden you can recieve mails but cannot send. Outlook will popup a message saying ‘
Outlook data file cannot be accessed (error 8004010F)‘.
Thou the PST files are there and accessible, the only way to fix this is to re-create your Outlook Profile from the Control Panel by:
Open Control Panel
Open Mail 32-bit
Click on Show Profiles
Select the profile in question
Now open Outlook and reconfigure the account. This should fix the problem
To Backup a database from command-line and using SQL 2000 MSDE version, you must use the SQLMAINT.EXE file situated in the ‘C:\Program Files\Microsoft SQL Server\MSSQL\Binn’
The backup cannot be done for all databases at once and it must be done individually. This can be done by the line below and then just duplicate it for multiple databases.
Create a batch file and run the following:
CD "C:\Program Files\Microsoft SQL Server\MSSQL\Binn"
sqlmaint -D "MyDB" -BkUpDB "X:\Backups\Data" -Rpt "X:\Backups\Reports\MyDB.txt" -BkUpMedia DISK
Sometimes when you need to automate some stuff from the SQL server you need to create a batch file and run it in the Task Scheduler. This way you can run the jobs you need to do and then run the executable or batch file you need from a Stored Procedure.
Firstly you need to make sure that the XP_CMDSHELL is enabled. This will allow you to execute the files from SQL.
This can be easily done from the Surface Area Configuration tool or by executing the following code:
EXEC master.dbo.sp_configure ‘show advanced options’, 1
EXEC master.dbo.sp_configure ‘xp_cmdshell’, 1
This should enable the XP_CMDSHELL. Now to execute a file you need to add the following SQL code to your present Stored procedure:
DECLARE @myfile varchar(200)
SET @myfile = ‘C:\sysfiles\copytootherserver.bat’
EXEC master..xp_cmdshell @myfile
For Windows Vista and 7. This might have happen to most of us. When you log in your profile, you get a popup on the bottom right that says ‘You have been logged on with a temporary profile. You cannot access your files and files created in this profile will be deleted when you log off. This sometimes happens when the username has either been changed or the folder of the profile has been deleted. So Windows will continue to look for it and leave you with a temporary profile. To fix this you need to make the following to restore the folder.
:: Log on the machine as an Administrator
:: Click on Start and type regedit
:: Find the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
:: There are a lot of folders in the key. Find the ones with the .BAK at the end
:: Delete the profiles in question with the .BAK extention (Make sure you take a backup of the registry first)
:: Close Regedit
:: Restart PC
After you log into the computer, the profile folder you are having problems with is re-created.
Sometime you will note that some network interfaces would either not work or just give errors. This usually occurs when using images on HyperV but just in case you need to remove hidden or phantom devices like ‘network adapter #5’, here’s how.
:: Open command prompt
:: Type CMD
:: Type set devmgr_show_nonpresent_devices=1
:: From the same window (Do not close the window in this process), type devmgmt.msc
This will load the Device Manager. Now, click on ‘View’ and select ‘Show hidden devices’.
Now you can simply either delete the hidden/phantom interfaces or uninstall the device.
Open the Exchange Powershell and type the following to view the language of the mailbox.
Get-Mailbox -Identity "Noel Pulis" | fl name, languages
Now, to change the language of the mailbox use the below, for example the code below will change my mailbox to English.
Set-Mailbox -Identity "Noel Pulis" -Languages "en-GB"
Making a scheduled automated shrink logs for the databases with specific space to shrink.
DECLARE @Step1 VARCHAR(200)
DECLARE @Name varchar(50)
DECLARE DBNames CURSOR
SELECT NAME FROM sysdatabases WHERE dbid > 4
FETCH NEXT FROM DBNames INTO @Name WHILE (@@FETCH_STATUS <> -1)
SET @Step1 = 'USE ' + @Name + '' + CHAR(10)
SET @Step1 = @Step1 + 'ALTER DATABASE [' + @Name + '] SET RECOVERY SIMPLE;' + CHAR(10)
SET @Step1 = @Step1 + 'DBCC SHRINKFILE (' +@Name + '_LOG, 500);' + CHAR(10)
SET @Step1 = @Step1 + 'ALTER DATABASE [' + @Name + '] SET RECOVERY FULL;' + CHAR(10)
FETCH NEXT FROM DBNames INTO @Name