The most important codes used for Microsoft Exchange Importing

Hi guys, Last week I had a problem with Microsoft Exchange databases and one of my databases are corrupted. There had 60 users in the corrupted database and again there were 74 non-working users anymore in the same database. Even I’m not mentioned in the other databases users.

Thank god I had backup file because I was taking every night full backup. I hadn’t seen this problem before it. I could have recovered my database but I couldn’t be sure and I choose the hard way for this job. This progress continued for a week but I’m also done. Finally, I have overcome this problem with successfully. I want to give thanks to Hakan Uzuner and Efe Sülükçü that they guys helped me.

I used codes at the below and started tracking the progress for hours.

The most important codes used for Microsoft Exchange Importing at the below.

Importing a user’s pst file

New-MailboxImportRequest -Mailbox Alias.Name -FilePath \\servername\PSTExport\PstName.pst

If there are bad items in the database while importing request, you can add this code at the end of the importing request code. It will ignore until 100 bad items.

New-MailboxImportRequest -Mailbox Alias.Name -FilePath \\servername\PSTExport\PstName.pst -BadItemLimit 100 -AcceptLargeDataLoss

If you want to see importing requests as percentage;

Get-MailboxImportRequest | Get-MailboxImportRequestStatistics -IncludeReport

If you want to delete importing request situations completed or failed;

Get-MailboxImportRequest -Status Completed | Remove-MailboxImportRequest

Get-MailboxImportRequest -Status Failed | Remove-MailboxImportRequest

You can resume the progress which importing request is failed.

Get-MailboxImportRequest -Status Failed | Resume-MailboxImportRequest

If you want to export the situation of the failed request to a .txt file.

Get-MailboxImportRequest -Status Failed | Get-MailboxImportRequestStatistics -IncludeReport | fl > C:\Importsallfailedreport.txt

If you want to export the bad items to a .txt file.

Get-MailboxImportRequest -Status Failed | Get-MailboxImportRequestStatistics -IncludeReport | Format-List | out-file baditems.txt

If you want to see which databases belong to which users.

Get-Mailbox | Sort database, name | Format-Table name, database

Thanks for reading.

See you later in another article.


Remotely manage Hyper-V 2016 via Windows 10

Hi guys again, If you want a fast server and if are you going to use only hyper-v server role, you can use hyper-v core. By the way, after installed windows server 2016 core, you are going to need some information at the below. I tested with my own experience and used it at one of my freelance projects. These informations are short and easy. Good lucks while working your works.

On the Hyper-V server

  • Install Hyper-V Server 2016 (without GUI)
  • Set server name
  • Enable Configure remote management
  • Enable Remote Desktop
  • Set server’s network IP address

Run PowerShell as Admin and run in sequence the commands at the below on your Server

Install-WindowsFeature Hyper-V

Enable-NetFireWallRule -DisplayName “Windows Management Instrumentation (DCOM-In)”

Enable-NetFireWallRule -DisplayGroup “Remote Event Log Management”

Enable-NetFireWallRule -DisplayGroup “Remote Service Management”

Enable-NetFireWallRule -DisplayGroup “Remote Volume Management”

Enable-NetFireWallRule -DisplayGroup “Windows Firewall Remote Management”

Enable-NetFireWallRule -DisplayGroup “Remote Scheduled Tasks Management”

Get-NetFirewallProfile | Set-NetFirewallProfile -enabled false


Enable-WSManCredSSP -Role server

And run the last command on the management server to be done:

Enable-NetFirewallRule -DisplayGroup “Remote Volume Management.”

On the Client Machine (Windows 10)

You are going to do some changes to manage Hyper-V Server. And now Run PowerShell as Admin and run in sequence the commands at the below.


Set-Item WSMan:\localhost\Client\TrustedHosts -Value ServerName

Enable-WSManCredSSP -Role client -DelegateComputer ServerName

Enable-WindowsOptionalFeature -Online -FeatureName:Microsoft-Hyper-V -All

cmdkey /add:ServerName /user:ServerAdministratorName /pass:ServerAdministratorPassword

Look at the picture at the below for example.

core server settings on windows 10

  • Change network type to Private
  • Add a DNS entry in your hostfile, for example “192.x.x.x ServerName“. After this process, be sure you can send ping packets from client to server.

ping hyper-v core server

  • Changed group policy: “Computer Configuration > Administrative Templates > System > Credentials Delegation > Allow delegating fresh credentials with NTLM-only server authentication” by doing: “Click Enable and add wsman/ServerName”
  • Disabled firewall
  • dcomcnfg > COM SECURITY > Access Permissions > Edit Limits > Anonymous Login > ALLOW Remote Access

If you have done everything, you can connect to your core server successfully like this picture.

See you later in another article.


Error: Download failed on Wsus Server

Hi guys,

I know I haven’t been publishing a new article in my blog for over a year. I don’t know why and wanted to write again. This article includes some tips. If you saw this error (Download failed on Wsus Server) on your wsus server, you can solve the problem easily. I’ll give you some information at the below and you can also follow step by step that I gave you informations. I doubt the source of the problem but I have an idea. Before you see the error, if you used the server cleanup wizard tool, this tool might be removed old updates on your wsus server. After then if you added a new client in your domain controller and if this client didn’t find updates for required own operating system over wsus server. It might be reason to the problem.

I offen use Psexec while working and I used it again to solve this problem. If you haven’t seen what is the psexec, you can see it by click here. It is very useful tool for IT staffs.

Please try the following steps on the client:

1. Start Windows PowerShell or Administrator Command Prompt run as Administrator.

2. Stop the Automatic Updates service and BITS service.

net stop wuauserv
net stop bits

3. Delete “%windir%\softwaredistribution” directory.

4. Start the Automatic Updates service and BITS service. When these two services have been started, they will auto-create “softwaredistribution” and its subfolder at system directory.

net start wuauserv
net start bits

5. After the “%windir%\softwaredistribution” directory has been generated, please let the client contact the WSUS server immediately.

wuauclt.exe /resetauthorization /detectnow

6. After 30 minutes, please check the client to confirm whether it detects needed updates.

Best regards