Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Apr 15, 2025

Windows 10/11 : Batch File to Start and Check Windows Services

Create a batch file to check the status of a Windows Service(s) and start it if its not started. The batch file can also be run inside "Task Scheduler" at an interval basis.


1. First, you need to find out the Service Name that you want to monitor, in this example let's say the service you need to monitor is an Exchange Server IMAP4 service.


2. Open --> Services and browse through the list until you found the IMAP4 service.


3. Right-click the Service Name --> Properties.


4. Take note of the "Service name:", copy the name to Notepad. As per below screenshot, the service name is "MSExchangeImap4".



5. Create a batch file as below :-


@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



6. You can now test run the batch file and create a "Task Scheduler" to run the check at an interval basis (eg. every 2 hours or at Startup of the server).



!!! HAPPY COMPUTING !!!

Nov 18, 2024

NextCloud Install in Ubuntu Server

NextCloud is an Open Source, Self-Hosted or Cloud Hosted, File Sync and Sharing Platform. It's Secure, Private and Easy to use. Compatible with Windows, Linux, Android and Apple iOS devices.

This is assuming that you already have Ubuntu Server installed, patched and updated.

1. Download the latest version of NextCloud.

sudo wget https://download.nextcloud.com/server/releases/latest.zip


2. Install some required packages.


sudo apt install libmagickcore-6.q16-6-extra php php-apcu php-bcmath php-cli php-common php-curl php-gd php-gmp php-imagick php-intl php-mbstring php-mysql php-zip php-xml -y



3. Install Marid DB Server.

sudo apt install mariadb-server -y


4. Secure Marid DB installation, follow on-screen prompt and instructions.

sudo mysql_secure_installation


5. Configure Maria DB Server.


CREATE DATABASE nextcloud;

SHOW DATABASES;

GRANT ALL PRIVILEGES ON nextcloud.* TO 'ncuser'@'localhost' IDENTIFIED BY 'ncpass';

FLUSH PRIVILEGES;

QUIT;



6. Enable PHP Modules.

sudo phpenmod apcu bcmath gmp imagick intl


7. Install Unzip Apps.

sudo apt install unzip -y


8. Unzip the downloaded NextCloud file.

sudo unzip latest.zip


9. Copy and Rename the extracted NextCloud folder.

sudo cp nextcloud demo.com


10. Move the renamed folder to Apache server path.

sudo mv demo.com /var/www/


11. Grant permissions to NextCloud folder.

sudo chwon -R www-data:www-data /var/www/demo.com


12. Create Apache configuration file for NextCloud.


<VirtualHost *:80>
   ServerAdmin webmaster@local.com
   ServerName demo.com
   DocumentRoot /var/www/demo.com

   <Directory /var/www/demo.com>
     Options MultiViews FollowSymlinks
     AllowOverride All
     Order allow,deny
     Allow from all
   </Directory>

   ErrorLog /var/log/apache2/demo.com/error.log
   TransferLog /var/log/apache2/demo.com/access.log

  <IfModule mod_headers.c>
     Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
   </IfModule>

</VirtualHost>



13. Configure and modify PHP file. Modify the value according to your requirements.


memory_limit = 512M

upload_max_filesize = 512M

max_execution_time = 360

post_max_size = 512M

date.timezone = Asia/Kuala_Lumpur

opcache.enable = 1

opcache.interned_strings_buffer = 16

opcache.max_accelerated_files = 10000

opcache.memory_consumption = 128

opcache.save_comments = 1

opcache.revalidate_freq = 1



14. Enabled Apache modules for NextCloud use.

sudo a2enmod dir env headers mime rewrite ssl


15. Enable APCU module in PHP.

sudo nano /etc/php/8.3/mods-available/apcu.ini

add the following line :-

apc.enable_cli = 1


16. Open your favorite browser, such as Google Chrome browser. And type the URL of NextCloud server (eg. http://demo.com). At the main screen, you need to configure the NextCloud Database (eg. nextcloud) created earlier including its username (eg. ncuser) & password (eg. ncpass). You also need to create the First Administrator account with a valid email address too.


17. NextCloud screen will auto refresh upon successful connection to the database, now login with the new administrator account created in earlier step.


18. Secure NextCloud with Let's Encrypt SSL.

sudo certbot --apache


19. Fix missing Indices in NextCloud.

sudo chmod +x /var/www/demo.com/occ

sudo /var/www/demo.com/occ db:add-missing-indices

sudo chmod -x /var/www/demo.com/occ


20. Change permissions of NextCloud config file.

sudo chmod 660 /var/www/demo.com/config/config.php

sudo chown root:www-data /var/www/demo.com/config/config.php


21. Modify NextCloud configuration file.

sudo nano /var/www/demo.com/config/config.php

Modify the following lines according to you needs :-


'memcache.local' => '\OC\Memcache\APCu',

'default_phone_region' => 'MY',

'maintenance_window_start' => 1,

'filelocking.enabled' => true,

'memcache.locking' => '\OC\MemCache\APCu',



22. Restart Apache server.

sudo systemctl restart apache2


23. Configure Crontab.

sudo crontab -u www-data -e

Add the following line :-

00 * * * 1 php -f /var/www/demo.com/cron.php



OPTIONAL STEPS

24. Remove Skeleton Files and Folders when User account is created.

sudo rm -R /var/www/demo.com/core/skeleton/Templates


25. Remove Work Flow Engine, to prevent User from installing WorkFlow.


sudo /var/www/demo.com/occ config:app:set workflowengine user_scope_disabled --value yes



26. Install "Redis" as MemCache for NextCloud.

sudo apt install redis php-redis -y

sudo systemctl enable redis

sudo systemctl start redis

sudo nano /var/www/demo.com/config/config.php


'memcache.local' => '\OC\Memcache\Redis',

'memcache.locking' => '\OC\Memcache\Redis',

'redis' => array(
     'host' => '/var/run/redis/redis.sock'.
     'port' => 0,
     'timemout' => 0.0,
     ),


sudo nano /etc/redis/redis.conf


unixsocket /var/run/redis/redis.sock

unixsocketperm 660


sudo usermod -aG redis www-data

sudo systemctl restart redis


27. If Redis is distributed, add following line into NextCloud config file :-

'memcache.distributed' => '\OC\Memcache\MemCached',


28. To clear all NextCloud log entries.

sudo -u www-data truncate /var/www/demo.com/data/nextcloud.log --size=0



!!! HAPPY COMPUTING !!!


Aug 16, 2024

Windows : Microsoft Edge Browser with Script

Sometimes we just need to create a shortcut that run Microsoft Edge browser to a specific URL or Website. This could be achieved easily if your "Default" browser is configured to Microsoft Edge, but what if your computer have 2 or more browsers like Google Chrome ?

This is especially true if the "Default" browser is configured to Google Chrome and that specific URL or Website only works with Microsoft Edge.

Thus by simply creating a shortcut to open that specific URL will only opens up Google Chrome instead of Microsoft Edge which is a bummer.

Let's get started :-

1. First you will need to create .vbs file with the following code.


Set Edge = CreateObject("WScript.Shell")
Edge.Run "msedge.exe https://demo.com"


* Replaced https://demo.com with your specific URL.

2. Save the above file as "edge.vbs", you can of course name it whatever filename you want.


3. Then create the shortcut to that "edge.vbs" on your desktop or any location you preferred.


4. If you want Microsoft Edge to open up with "Maximized" screen, just add the following line into .vbs file.


Set Edge = CreateObject("WScript.Shell")
Edge.Run "msedge.exe https://demo.com", 3, false



Now Microsoft Edge will open that specific website in maximized screen.


!!! HAPPY COMPUTING !!!

Jul 18, 2024

Windows : DISM Error "0x800f081f"

Fixing the DISM Error "0x800f081f". Depending on what you are trying to achieve, in my case is the failure of installing .NET Framework 3.5 in Windows Server 2012 R2 Std 64-bit.

The error message :


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



1. Check the Windows Protected files scan.

sfc /scannow

Results with error :


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.



2. Scan the image with dism.

dism /online /cleanup-image /scanhealth

Results with error :


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



3. Repairing the files.

dism /online /cleanup-image /restorehealth /source:D:\sources\install.wim /limitaccess


4. Once completed, restart the computer and proceed to install the .NET Framework 3.5

dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess


5. Once done, restart the computer again and the new features is already installed.


!!!HAPPY COMPUTING !!!


Windows 11 : Classic Context (Right-Click) Menu

No idea what Microsoft is thinking when they designed the Windows 11 OS, the additional "clicks" required to just access the "Context (Right-Click) Menu" is so inconvenience and troublesome to Users.

To resolve this, a simple registry modification is required :-

1. Open --> regedit.exe

2. Browse --> HKEY_CURRENT_USER\Software\Classes\CLSID

3. Create a new "Key" --> {86ca1aa0-34aa-4e8b-a509-50c905bae2a2}

4. Then create a "Sub" key under the newly created key --> InprocServer32

5. Under the "InprocServer32" key, modify the string value of --> (Default) = [Blank]

Before :-

After :-



6. Once done, close all applications and restart the computer.

The old / classic context menu is now available automatically.


!!! HAPPY COMPUTING !!!

Feb 21, 2024

Windows 10 : Create Recovery Partition

Sometimes we just need to fix the Windows Recovery Partition or just wanted to increase that partition size so that Windows Update able to run without any error.

The recommended Recovery Partition size by Microsoft is at least 1GB.

There are 2 scenarios here :-

1. The Recovery Partition is NOT available in the HDD/SSD.

2. The Recovery Partition is available but the size is too small (eg. less than 1GB).


METHOD 1 (No Recovery Partition).

1. Open --> Computer Management.

2. Goto --> Disk Management.

3. Right-Click on [C:] drive, select --> Shrink Volume.

4. Decrease the [C:] drive volume, enough to have a balance of 1GB (or 1000 MB).

5. Once the [C:] drive volume have shrinked successfully, you will now see an empty volume available.

6. Create the a new partition on the empty volume, FORMAT it but do not assign any drive letter yet.

6. Now, open --> CMD (as admin).

7. Run --> Diskpart utility and set the correct configurations for Recover Partition to work.

C:\>diskpart

8. List all available drive and select the correct drive.

DISKPART>list disk

DISKPART>select disk 0

9. Next, is to display all the available partition in that drive and select the new partition. Assuming that the new partition is numbered 4.

DISKPART>list partition

DISKPART>select partition 4

10. Now we need to configure the partition, depending on your drive's configuration it may either be MBR or GPT type. Choose the correct command based on your drive's configuration.

MBR
DISKPART>set id=27

GPT
DISKPART>set id=06d1-4d40-a16a-bfd50179d6ac

DISKPART>gpt attributtes=0X8000000000000001

11. Once done, just exit the Diskpart utility.

12. Now we need to enable and create the recovery partition. This make take a while to complete.

C:\>reagentc /enable

13. Once completed, you should now be able to view the new partition have been identified as "Recovery Partition" in the Disk Management panel.


METHOD 2 (Exiting Recovery Partition).

1. If there is an existing Recovery Partition in the drive, we need to first disable it. Open --> CMD (as admin).

C:\>reagentc /disable

2. Next is to run Diskpart utility.

C:\>diskpart

3. List all available drive and select the correct drive.

DISKPART>list disk

DISKPART>select disk 0

4. Next, is to display all the available partition in that drive and select the new partition. Assuming that the existing Recovery Partition is numbered 4.

DISKPART>list partition

DISKPART>select partition 4

5. As the Recovery Partition cannot be deleted, we need to force delete the partition.

DISKPART>delete partition override

6. Open --> Computer Management.

7. Goto --> Disk Management.

8. Right-Click on [C:] drive, select --> Shrink Volume.

9. Decrease the [C:] drive volume, enough to have a balance of 1GB (or 1000 MB) on the empty volume.

10. Once the [C:] drive volume have shrinked successfully, you will now see an empty volume available.

11. Create the a new partition based on the empty volume, FORMAT it but do not assign any drive letter yet.

12. Back to the command prompt and while still in Diskpart utility, we need to ensure the correct partition is selected.

DISKPART>select partition 4

13. Now we need to configure the partition, depending on your drive's configuration it may either be MBR or GPT type. Choose the correct command based on your drive's configuration.

MBR
DISKPART>set id=27

GPT
DISKPART>set id=06d1-4d40-a16a-bfd50179d6ac

DISKPART>gpt attributtes=0X8000000000000001

14. Once done, just exit Diskpart utility and next is to re-enable back the Recovery Partition. This may take a while to complete.

C:\>reagentc /enable

15. Once completed, you should now have a larger Recovery Partition size in the Disk Management panel.



!!! HAPPY COMPUTING !!!


Nov 8, 2023

Batch : Rename Hostname via Batch File

This is an example of a batch file to rename the Hostname or Computer Name as per your preferences, it is much faster way to do computer renaming for many computers.

Note that the batch file must be "run as administrator" mode in order to works.

 @ECHO OFF
CLS
>NUL CHCP 65001

:asktorename
REM To ask whether to Rename the Hostname or not.
ECHO.
ECHO.
ECHO.
ECHO               ╔═════════════════════════════════════════╗
ECHO               ║         RENAMING THE HOSTNAME           ║
ECHO               ╚═════════════════════════════════════════╝
ECHO.
CHOICE /M "──────────────► DO YOU WANT TO RENAME THE HOSTNAME "
    IF ERRORLEVEL 2 GOTO eof
    IF ERRORLEVEL 1 GOTO askforname
GOTO eof
REM --------------------------------------------------------------------------------------

:askforname
REM To ask User for the preferred hostname.
ECHO.
ECHO.
SET /P NEWNAME="PLEASE TYPE THE NEW HOSTNAME: "
ECHO.
ECHO "     ► ► ► THE NEW HOSTNAME IS ───► %NEWNAME%"
CHOICE /M "     ► ► ► IS THIS CORRECT "
    IF ERRORLEVEL 2 GOTO asktorename
    IF ERRORLEVEL 1 GOTO dorenhost
GOTO eof
REM --------------------------------------------------------------------------------------

:dorenhost
REM To proceed Rename the Hostname as per Input by User.
ECHO.
ECHO "     ► ► ► OK, RENAMING HOSTNAME → %NEWNAME%, PLEASE WAIT..."
WMIC COMPUTERSYSTEM where name="%COMPUTERNAME%" CALL RENAME name="%NEWNAME%"
TIMEOUT /t 3 /NOBREAK
ECHO.
ECHO "     ► ► ► RENAMING HOSTNAME COMPLETE"
ECHO.
ECHO "THE NEW HOSTNAME WILL TAKE EFFECT AFTER COMPUTER RESTART"
TIMEOUT /t 5 /NOBREAK
GOTO eof
REM --------------------------------------------------------------------------------------

:eof
START SHUTDOWN /r /f /t 10
COLOR
>NUL CHCP 437
EXIT /b



!!! HAPPY COMPUTING !!!

Sep 15, 2023

Windows 11 : Built-In Apps that can be Remove

Windows 11 comes bundled with a some Apps that may or may not be needed in a Corporate environment, these may include App such as Xbox, Video Editor etc.

But removing all those unnecessary Apps maybe troublesome, and worst breaking the "SysPrep" function and further preventing for a mass deployment.

Below are the few Apps that can be removed safely without breaking "SysPrep" functionality. You will need to remove script lines for App(s) that you want to retain.

Copy and save the file as PowerShell Script (.ps1).

 

Write-Host
Write-Host
Write-Host "**************************"
Write-Host "* Removing Appx Packages *"
Write-Host "**************************"
Write-Host
Write-Host "Removing Zune Video..."
Get-AppxPackage -AllUsers *ZuneVideo* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Zune Music..."
Get-AppxPackage -AllUsers *ZuneMusic* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft Your Phone..."
Get-AppxPackage -AllUsers *YourPhone* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Xbox Speech..."
Get-AppxPackage -AllUsers *XboxSpeech* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Xbox Identity..."
Get-AppxPackage -AllUsers *XboxIdentity* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Xbox Gaming Overlay..."
Get-AppxPackage -AllUsers *XboxGamingOverlay* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Xbox Game Overlay..."
Get-AppxPackage -AllUsers *XboxGameOverlay* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Xbox App..."
Get-AppxPackage -AllUsers *XboxApp* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Xbox TCUI..."
Get-AppxPackage -AllUsers *Xbox.TCUI* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Windows Maps..."
Get-AppxPackage -AllUsers *WindowsMaps* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Windows Feedback Hub..."
Get-AppxPackage -AllUsers *WindowsFeedbackHub* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Windows Communications Apps..."
Get-AppxPackage -AllUsers *windowscommunicationsapps* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Windows Alarms..."
Get-AppxPackage -AllUsers *WindowsAlarms* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft People..."
Get-AppxPackage -AllUsers *Microsoft.People* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Solitaire Collection..."
Get-AppxPackage -AllUsers *MicrosoftSolitaireCollection* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Office Hub..."
Get-AppxPackage -AllUsers *MicrosoftOfficeHub* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Windows Get Started..."
Get-AppxPackage -AllUsers *GetStarted* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Windows Get Help..."
Get-AppxPackage -AllUsers *GetHelp* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Bing Weather..."
Get-AppxPackage -AllUsers *BingWeather* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft Gaming App..."
Get-AppxPackage -AllUsers *GamingApp* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft Bing News..."
Get-AppxPackage -AllUsers *BingNews* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft Teams App..."
Get-AppxPackage -AllUsers *MicrosoftTeams* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft To Dos App..."
Get-AppxPackage -AllUsers *Microsoft.Todos* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft Power Automate Desktop App..."
Get-AppxPackage -AllUsers *Microsoft.PowerAutomateDesktop* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft ClipChamp App..."
Get-AppxPackage -AllUsers *Clipchamp* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft Windows Terminal App..."
Get-AppxPackage -AllUsers *WindowsTerminal* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host
Write-Host "Uninstallation of AppxPackages Completed."
Start-Sleep -s 5 
Write-Host
Write-Host
Write-Host "**************************************"
Write-Host "* Removing Appx Provisioned Packages *"
Write-Host "**************************************"
Write-Host
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Zune Video..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.ZuneVideo_2019.22091.10041.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Zune Music..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.ZuneMusic_11.2305.4.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft Your Phone..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.YourPhone_1.22022.147.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Xbox Speech..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.XboxSpeechToTextOverlay_1.17.29001.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Xbox Identity..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.XboxIdentityProvider_12.50.6001.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Xbox Gaming Overlay..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.XboxGamingOverlay_2.622.3232.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Xbox Game Overlay..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.XboxGameOverlay_1.47.2385.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Xbox TCUI..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.Xbox.TCUI_1.23.28004.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Windows Maps..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsMaps_2022.2202.6.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Windows Feedback Hub..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsFeedbackHub_2022.106.2230.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Windows Communications Apps..."
Remove-AppxProvisionedPackage -Online -PackageName microsoft.windowscommunicationsapps_16005.14326.20544.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Windows Alarms..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsAlarms_2022.2202.24.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft People..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.People_2020.901.1724.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Solitaire Collection..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.MicrosoftSolitaireCollection_4.12.3171.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Office Hub..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.MicrosoftOfficeHub_18.2204.1141.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Windows Get Started..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.Getstarted_2021.2204.1.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Windows Get Help..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.GetHelp_10.2201.421.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Bing Weather..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.BingWeather_4.53.33420.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft Gaming App..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.GamingApp_2021.427.138.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft Bing News..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.BingNews_4.2.27001.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft Teams..."
Remove-AppxProvisionedPackage -Online -PackageName MicrosoftTeams_23231.411.2342.9597_x64__8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft Power Automate Desktop App..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.PowerAutomateDesktop_10.0.3735.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft ClipChamp App..."
Remove-AppxProvisionedPackage -Online -PackageName Clipchamp.Clipchamp_2.2.8.0_neutral_~_yxz26nhyzhsrt
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft To Dos App..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.Todos_2.54.42772.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft Windows Terminal App..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsTerminal_3001.12.10983.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host
Write-Host
Write-Host "*******************************************************"
Write-Host "* Uninstallation of AppxProvisionedPackage Completed. *"
Write-Host "*******************************************************"
Start-Sleep -s 5
EXIT

 

 


!!! HAPPY COMPUTING !!!

Sep 9, 2023

VMWare : VMWare Tools for Windows XP 32-bit

VMWare Tools for Windows XP 32-bit, the tools is deprecated thus use at own risks.

1. Download the old version of VMWare Tools v.10.0.2 (https://drive.google.com/file/d/1nnjHGeavqOCjWIQSTCC6x-ksxnrCNCKX/view?usp=sharing)

2. Copy the Zip file into the VM Guest.

3. Extract the Zip inside the VM Guest.

4. Install a compatible CDROM or ISO Emulator (https://wincdemu.sysprogs.org/) or any preferred utility for Windows XP.

5. Mount the ISO file, search for "WinPreVista.ISO" and mount it as a CDROM drive.

6. Double-Click the drive for autorun, or browse it and run the setup according to your architecture. Such as "setup.exe" for 32-bit OS or "setup64.exe" for 64-bit OS.

7. Follow the on-screen instructions to complete the installations.

8. Once completed, eject or un-mount the drive and restart the VM.


!!! HAPPY COMPUTING !!!

Sep 5, 2023

Windows : Get Operating System Info in Command Prompt

How to get the installed Operating System information via the Command Prompt.

1. To get OS Architecture type.

wmic os get OSArchitecture



2. To get OS Edition info.

wmic os get Caption /value



3. To get OS CD-Key info.

wmic path softwareLicensingService get OA3xOriginalProductKey



!!! HAPPY COMPUTING !!!

Aug 30, 2023

Windows Terminal : Always Run as Administrator

How to Enable Windows Terminal to always "Run as Administrator" option.

1) Open --> Windows Terminal

2) Goto --> Settings

3) Under "Profile" section, select which profile you want to enable, in this case select --> Command Prompt

4) On the right-pane, scroll down and search for --> Run this profile as Administrator = On


!!! HAPPY COMPUTING !!!

Aug 11, 2023

Windows 10 : Delete Recovery Partition

Windows 10 "Recovery" partition is a special partition on system hard drive and is used to restore the system to factory settings in the event of system issues. To protect the recovery partition from being changed or deleted, the recovery partition usually doesn't have any drive letter assigned and other features or options are not available in Disk Management.

This "Recovery" partition can be deleted and it will not impact your existing Windows 10 OS. Though it can be deleted but to delete it, you must follow this steps.


NOTE : IT IS RECOMMENDED NOT TO DELETE THIS PARTITION ! DOING SO, YOU WILL NOT HAVE ANY LAST RESORTS IN THE EVENT OF OS ISSUES.



1. Run --> CMD (run as admin)

2. Type --> diskpart

3. Type --> list disk

4. Type --> select disk [number]
     (usually primary disk number is 0)

5. Type --> list partition

6. Type --> select partition [number]
     (in this case my, based on my drive's partition layout, the number is 4)

7. Type --> delete partition override

8. Type --> exit

9. Now, open "Disk Management" and you will notice that now there is a "Unallocated" space available in the drive.

10. Next step is to extend your [C:] drive by right-click --> Extend volume.

11. Ensure the full size is selected and click --> Next

12. Verify the new configuration and click --> Finish

Now you will have a larger capacity of the [C:] drive partition.


!!! HAPPY COMPUTING !!!

May 26, 2023

Windows : Fix Windows 7 Update Error 80072EFE

 Fix Windows 7 Update Error 80072EFE.

Download and run update KB3138612, select the correct architecture.

  1. Windows 7 64-bit --> Windows6.1-KB3138612-x64.msu
  2. Windows 7 32-bit --> Windows6.1-KB3138612-x86.msu
After installed & restart computer, Windows Update will be able to run without any error.


!!! HAPPY COMPUTING !!!

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 :

  1. Microsoft Report Viewer 2008 Redistributable (https://www.microsoft.com/en-us/download/details.aspx?id=3203).

Steps to Install WSUS.
  1. Open --> Server Manager
  2. Click --> Add roles and features
  3. Scroll down and Select --> Windows Server Update Services
  4. When Prompted, Click --> Add Features
  5. Continue to Click --> Next
  6. Ensure the following is selected --> WID Database & WSUS Services
  7. Specify WSUS Storage Location (eg. D:\WSUS_Store), ensure sufficient storage spaces is available to store all downloaded updates.
  8. Continue to Click --> Next
  9. Until final Click --> Install
  10. Wait until the Installation Wizard complete.

Post-Installation Steps.
  1. Open --> Windows Server Update Services (available inside "Administrative Tools").
  2. When prompted, ensure the storage location is correct (eg. D:\WSUS_Store), it may a while so please wait until it finishes.
  3. When completed, Click --> Close
  4. Optional to join Microsoft Update Improvement Program, Click --> Next
  5. If this is the first / Primary WSUS, then select --> Synchronize from Microsoft Update
  6. Proceed to configure "Proxy Server" settings (if any).
  7. Next is to connect to Microsoft Update server, Click --> Start Connecting
  8. Once completed, select the language (eg. English) and Click --> Next
  9. Select the products you want to download the updates for (eg. Windows 10).
  10. Next is to select the "Classifications" you want, such as Critical Updates, Security Updates etc.
  11. Configure the synchronization schedules as required.
  12. Select --> Begin initial synchronization
  13. Wait until complete.
 


!!! HAPPY COMPUTING !!!


Apr 21, 2023

Windows Server : Google Chrome Policy for Active Directory GPO

How To add Google Chrome Policy into Active Directory GPO (Group Policy Object).

At times SysAdmin might have the needs to control certain aspect or settings of Google Chrome (such as Start/Home Page), this maybe a tasks too large when your company owns thousands of computers. The most easiest way to deploy the settings via GPO (Group Policy Object) in Active Directory.

This video will show you how to download the Google Chrome Policy (Officially) and deploy it to Active Directory GPO (Central Store) for a much easier and faster deployment, if you find my video useful, please do consider to "Like" and "Subscribe" to my channel (@DanielTechTips), it will means a lot to me. Thanks.



  1. Download Google Chrome Policy.
  2. Extract the download file and search for "windows" folder.
  3. Copy --> "chrome.admx & google.admx" files to Windows Server or to external storage.
  4. Copy also --> "en-US\chrome.adml & google.adml" files.
  5. Copy *.admx files to Windows Server "central store" located at --> %serverlogon%\sysvol\[domain name]\Policies\PolicyDefinitions
  6. Copy *.adml files to --> %serverlogon%\sysvol\[domain name]\Policies\PolicyDefinitions\en-US
  7. Now open --> Group Policy Management
  8. Verify "Google" policy is available for configurations.



!!! HAPPY COMPUTING !!!