|
@ECHO OFF CLS SETLOCAL ENABLEDELAYEDEXPANSION SET /A RETRY_IMAP=0 SET /A MAX_RETRIES=3 SET EXCH_IMAP= MSExchangeImap4 REM To check current status of the service. :check_imap SC QUERY %EXCH_IMAP% | FIND "RUNNING" >NUL IF %ERRORLEVEL%==0 ( ECHO Exchange IMAP4 Service is Running. GOTO end ) REM To start the service if the status is stopped. ECHO Exchange IMAP4 Service is Stopped. SC START %EXCH_IMAP% TIMEOUT /T 10 >NUL REM To re-check the service status again for confirmation. SC QUERY %EXCH_IMAP% | FIND "RUNNING" >NUL IF %ERRORLEVEL%==0 ( ECHO Exchange IMAP4 Service is Running. GOTO end ) REM Retrying to start the service with a maximum of 3 retries only. SET /A RETRY_IMAP+=1 IF !RETRY_IMAP! LSS %MAX_RETRIES% ( ECHO Retrying Start %EXCH_IMAP% (Attemp: !RETRY_IMAP!). GOTO check_imap ) ELSE ( ECHO Max Retries Reached for %EXCH_IMAP%, will stop retrying. GOTO end ) :end EXIT |
Apr 15, 2025
Windows 10/11 : Batch File to Start and Check Windows Services
Jul 18, 2024
Windows : DISM Error "0x800f081f"
|
Error: 0x800f081f The source files could not be found. Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077. The DISM log file can be found at C:\Windows\Logs\DISM\dism.log |
| sfc /scannow |
Beginning system scan. This process will take some time. Beginning verification phase of the system scan. Verification 100% complete. Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log windir\Logs\CBS\CBS.log. For example C:\Windows\Logs\CBS\CBS.log. Note that logging is currently not supported in offline servicing scenarios. |
| dism /online /cleanup-image /scanhealth |
Deployment Image Servicing and Management tool Version: 6.3.9600.19408 Image Version: 6.3.9600.19397 [==============================100.0%============================] Error: 0x800f081f The source files could not be found. Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077. The DISM log file can be found at C:\Windows\Logs\DISM\dism.log |
| dism /online /cleanup-image /restorehealth /source:D:\sources\install.wim /limitaccess |
| dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess |
May 17, 2023
Multi-Boot USB : Ventoy (Open Source)
Ventoy is an open source tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files.
With Ventoy, you don't need to format the disk over and over, you just need to copy the ISO/WIM/IMG/VHD(x)/EFI files to the USB drive and boot them directly.
You can copy many files at a time and Ventoy will give you a boot menu to select them. You can also browse ISO/WIM/IMG/VHD(x)/EFI files in local disks and boot them.
Supports x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI. Most types of OS supported (Windows/WinPE/Linux/ChromeOS/Unix/VMware/Xen etc.)
Official Ventoy Website : https://www.ventoy.net/en/index.html
!!! HAPPY COMPUTING !!!
May 10, 2023
Windows Server : Install & Configure WSUS (Windows Server Update Services)
Windows Server : Install & Configure WSUS (Windows Server Update Services).
WSUS is available freely and is part of Windows Server OS (any edition).
Pre-Requisites :
- Microsoft Report Viewer 2008 Redistributable (https://www.microsoft.com/en-us/download/details.aspx?id=3203).
- Open --> Server Manager
- Click --> Add roles and features
- Scroll down and Select --> Windows Server Update Services
- When Prompted, Click --> Add Features
- Continue to Click --> Next
- Ensure the following is selected --> WID Database & WSUS Services
- Specify WSUS Storage Location (eg. D:\WSUS_Store), ensure sufficient storage spaces is available to store all downloaded updates.
- Continue to Click --> Next
- Until final Click --> Install
- Wait until the Installation Wizard complete.
- Open --> Windows Server Update Services (available inside "Administrative Tools").
- When prompted, ensure the storage location is correct (eg. D:\WSUS_Store), it may a while so please wait until it finishes.
- When completed, Click --> Close
- Optional to join Microsoft Update Improvement Program, Click --> Next
- If this is the first / Primary WSUS, then select --> Synchronize from Microsoft Update
- Proceed to configure "Proxy Server" settings (if any).
- Next is to connect to Microsoft Update server, Click --> Start Connecting
- Once completed, select the language (eg. English) and Click --> Next
- Select the products you want to download the updates for (eg. Windows 10).
- Next is to select the "Classifications" you want, such as Critical Updates, Security Updates etc.
- Configure the synchronization schedules as required.
- Select --> Begin initial synchronization
- Wait until complete.
Apr 21, 2023
Windows Server : Google Chrome Policy for Active Directory GPO
- Download Google Chrome Policy.
- Extract the download file and search for "windows" folder.
- Copy --> "chrome.admx & google.admx" files to Windows Server or to external storage.
- Copy also --> "en-US\chrome.adml & google.adml" files.
- Copy *.admx files to Windows Server "central store" located at --> %serverlogon%\sysvol\[domain name]\Policies\PolicyDefinitions
- Copy *.adml files to --> %serverlogon%\sysvol\[domain name]\Policies\PolicyDefinitions\en-US
- Now open --> Group Policy Management
- Verify "Google" policy is available for configurations.
Jan 7, 2023
RustDesk : Install RustDesk Server in Ubuntu
Install RustDesk Server in Ubuntu Server v.22.0.4 64-bit.
1. Check UFW is "Enabled" in Ubuntu.
$sudo ufw status
2. Enable UFW if not available.
$sudo apt install ufw -y
$sudo ufw enable
3. Configure default UFW settings.
$sudo ufw default allow outgoing
$sudo ufw default deny incoming
4. Allow SSH connection.
$sudo ufw allow ssh
$sudo ufw allow 22/tcp
5. Allow RustDesk Ports and Protocols.
$sudo ufw allow 21114:21119/tcp
$sudo ufw allow 8000/tcp
$sudo ufw allow 21116/udp
$sudo ufw allow http
$sudo ufw allow https
6. Install RustDesk Server.
$sudo wget https://raw.githubusercontent.com/dinger1986/rustdeskinstall/master/install.sh
$sudo chmod +x install.sh
$sudo ./install.sh
7. When prompted for IP/Domain Name, key-in a FQDN address. (eg. remote.abc.com)
8. When prompted to install Web Server (HTTPD), type "Yes" (if you haven't install Apache2 Server). It will auto install GoHttpd server (recommended).
9. Upon completion, please take note of the "Public Key, Username and Password" displayed on screen, copy it to notepad for future references.
10. Ensure your router also have "Port Forwarding" configured to match the RustDesk's ports as above.
11. At another computer, open any internet browser (eg. Chrome) and browse to http://[your domain]:8000 and you will prompted for username & password to login, use the same username and password save in above steps.
12. After successful login, proceed to download the installer for Windows, its a PowerShell script. After download proceed to run the script (run as admin).
13. Once installation completed, you can open/run the RustDesk Client on your computer.
Note: as of writing, the "Address Book" function was still under development and there are no timeline available for the release, thus the "Login" function in the "Address Book" module will return an error message.
Edit, 2-Apr-2023: Added Video.
!!! HAPPY COMPUTING !!!
Dec 24, 2020
Windows Server 2012 R2 : Azure AD Connect
A. Ports requirements.
- DNS = 53, TCP & UDP
- Kerberos = 88, TCP & UDP
- MS-RPC = 135, TCP
- LDAP = 389, TCP & UDP
- LDAP SSL = 636, TCP & UDP
- SMB = 445, TCP
- HTTPS = 443, TCP
- WinRM = 5985, TCP
- Azure Service Bus = 5671, TCP
- Dynamic Port Range-RPC = 49152 ~ 65535, TCP (Random High RPC Port)
- Objects < 10,000 = 1.6Ghz CPU, 4GB RAM, 70GB HDD.
- Objects 10,000 ~ 50,000 = Same as above.
- Objects 50,000 ~ 100,000 = 1.6Ghz CPU, 16GB RAM, 100GB HDD.
- Objects 100,000 ~ 300,000 = 1.6Ghz CPU, 32GB RAM, 300GB HDD (required a full fledge SQL server).
Oct 4, 2016
Exchange Server 2013 - POP3 Mail Collector using MDaemon
Some hosting provider does supports IMAP collections while some are not, this is because the server(s) the hosting provider is using was unable to support such protocols (due to whatever the reasons), so you are stuck in the middle to resolve this problems.
So either you change the hosting provider (which may incurred more cost) or you use an old Exchange server that still supports POP3 protocols (which you will not have the latest features & functions).
There are many solutions out in the internet that provide a workaround for this and I find many to be either ridiculous, too little functions/features, too complicated to configured or just plain unstable due to whatever the reasons.
I found that Quantum Software Solutions Exchange Connector to be the simplest software to use & to configure but due to unknown reasons, the software been giving me a lot of problems lately when my users reached more than 50 users and also I need to constantly monitor the server to manually restart it should it become freezes. It also causes missing emails, unable to send emails to my Exchange server and many more.
So I tried another solution based from my past experiences by using MDaemon Mail Server which I have deployed many times to many clients successfully. And some are still running fine without any problems until today..... now that's what I called stability.
After some trial and error, I have managed to make it work & to cut the story shorts below are some examples of the configurations :-
1. Install MDaemon Mail Server (you may need to check the compatibility list & plan your deployment accordingly). Just follow the on-screen instructions.
2. Goto --> "Setup" --> "Primary Domain" options --> "Domain/ISP" tab as shown below.
a) Domain name = [any local domain name will do, it must NOT be your actual domain].
b) HELO domain = [same as above]
c) Domain IP = [the IP address of the host you are running MDaemon].
d) ISP or smart host's IP or domain name = [your exchange server's IP address].
Note : DO NOT USE your company's actual domain name (eg. company.com.my), you must configure it to use something else (eg. company.local). You will understand why later when I describe how the mail flow works.
3. Goto --> "Ports" tab as shown below and change the "Create outbound SMTP events using this TCP port" option to something that are not standard (eg. 524).
4. Leave the rest configurations as default and click "OK" button.
5. Now goto --> "Setup" --> "Even Scheduling" and configure as shown below then click "OK" button when done.
Note : Some hosting provider limit time access to their server & to avoid lockup, ensure you configure this accordingly to your hosting provider, if in doubt check with them.
6. Now login to your Exchange's ECP, goto --> "mail flow" options.
7. Then goto --> "receive connectors" tab.
8. You will see a list of default transports, click on the plus sign "+" as show below.
9. At the "General" option --> "*Name" box, create a sensible name (eg. POP3 Receive Connector) as shown below.
10. Next goto --> "security" option and ensure its selected as per below options.
11. Then goto --> "scoping" option, configure as below & click the "save" button when done.
a) Ensure the IP address matches your LAN (eg. 192.168.0.*/24).
b) Ensure the port number is specified (eg. 524).
c) Ensure your Exchange server's FQDN is correct (eg. server.company.com.my).
12. Now proceed to logout from your ECP and return back to your MDaemon server, we are now ready to create users for MDaemon (I assume you have already created all the required users in Exchange server).
13. Goto --> "Accounts" menu --> "Accounts Manager" --> click "New" button, then it will display another windows as below. Under "Account" tab configure as shown.
a) Full name = Daniel Cheah
b) Mailbox name = daniel.cheah
c) @ = company.local
d) Account Password = [Password]
14. Browse to "Forwarding" tab --> select "This account is currently forwarding mail" option. Then key-in the FQDN email account (eg. username
15. Next is goto --> "MultiPOP" tab --> select "Enable MultiPOP mail collection for this account" option as shown below.
16. Now type-in your hosting provider's mail server details (eg. pop.provider.com.my) and the username & password (which you have already created in hosting provider's mail server) as shown below, once done click the "Add" button.
17. Once added, you will be able to see the list created as shown below, now click "OK" button to exit.
18. Now you can close all open windows and try send a test email, I will suggest using your own personal Hotmail or Gmail for this testing purposes to ensure MDaemon are able to collect the emails from the hosting provider's mail server and then automatically forward it to your local Exchange server accordingly.
The in your computer, open Microsoft Outlook (which you already configured to connect to your local Exchange server) and check whether you have receive the test email or not. If everything is correctly configured you should be receiving it around 5 mins time.
19. Below is a sample diagram of the incoming mail flow using Quantum Software Solution's Exchange Connector (QSS EC).
20. Below is a sample diagram of the incoming mail flow using MDaemon server.
21. From comparisons both diagram is almost the same but bear in mind that MDaemon is a full fledge server unlike QSS EC which are not.
So how does QSS EC works ?
- It collects emails from hosting provider's server via POP3 protocols.
- Verify recipients validity by cross checking with Active Directory via AD/LDAP protocols.
- If correct then forward the emails to your local Exchange server via IMAP4 protocols.
- Clients collects emails from Exchange server via IMAP4 protocols.
- If failed, then it will forward to the "Mail Master/Administrator" mailbox.
22. Now comparing to MDaemon's processing.
- Collect emails from hosting provider's server via POP3 protocols.
- Verify recipients with MDaemon's local DB (that is why the MDaemon server must not use the same domain name).
- Auto forward emails to "Smart Host" (which is your local Exchange server) via SMTP protocols on custom port.
- Exchange server verify the recipients & send to local mailboxes.
- Clients collects emails from Exchange server via IMAP4 protocols.
23. As for the sending emails out, clients will be using the IMAP4 protocols to send emails to your local Exchange server and then the Exchange server will send the emails out directly. It's the same for both QSS EC & MDaemon.
Of course you can also configured your Exchange server to forward it to your hosting provider's SMTP server and this is up to your decisions. But do keep in mind about the hosting provider's server where it might be lockup due to too many SMTP request from the same IP & thought its was a "spam overflow/DoS" attacks.
That's all and HAPPY EMAILING !!!
Jan 9, 2016
Server - Configuring DNS Forwarder (Windows Server 2012 R2)
After much time spend going through Microsoft TechNet & MSDN websites, I have found a simple solution to this.
How it works is that all DNS queries will definitely be going to the local DNS (else your local client will not be able to use the local services provided, such as file & printer sharing), as such local DNS queries will be responded by the local DNS server but other or external queries will return an error.
Now I assume you already have a local DNS server setup & running within your domain, just follow this steps :-
1. Open the "DNS Manager" console, goto START --> Control Panel --> Administrative Tools --> DNS.
3. Goto "Forwarders" tab and click the "Edit" button.
4. Add the DNS IP address as shown, you can also arrange which is the preferred DNS server by using the "Up" and "Down" button.
5. Once all is done, just click "OK" button to close all open windows. Now it does take sometimes for the DNS server to sync its database so be patient for it. Mine took about 15 mins to 30 mins for it to complete.
If you add an extra DNS server (like me, as I don't want to mess with my AD-DS server), you will also need to ensure that your DHCP server is providing the correct DNS address to all your clients in the network. Below diagram is just an example of how it works :-
Happy Computing !!!

















