How to add a local user to Windows 10 via PowerShell

PowerShell is very common to use these days as more and more software doing automation.  Many times it’s harder to find Graphical User Interface (GUI) to add a user or find other settings.  In this post, I am adding a local user via PowerShell and adding a user to a local group.  PowerShell has built-in help and examples too, so if you want to know more about the command just type Get-Help then Name of command and it will give more info about it. Let’s get started exploring the options starting with viewing current users.

To see current local users:

PS C:\> Get-LocalUser

To see Local Groups:

PS C:\> Get-LocalGroup

To see Local Groups Members:

PS C:\> Get-LocalGroupMember -Group Administrators

Adding a new user:

PS C:\>New-LocalUser –Name WhatEverName

When you hit Enter it will give you the option to put the password

Add user to Local Admin Group:

My example user name is: Admin replace that with your user name

PS C:\> add-LocalGroupMember -Group “Administrators” -Member “Admin”

To add more users to a Local admin group:

PS C:\> Add-LocalGroupMember -Group “Administrators” -Member “User1”, “User2”, etc…

To add a domain user to Local Administrator Group:

PS C:\> Add-LocalGroupMember -Group “Administrators” -Member YourDomainName\UserName

To remove a local user:

Make sure you have at least one user account and it’s a member of LocalAdmin group

PS C:\> Remove-LocalUser -Name WhatEverNameYouWantToRemove

To Remove a domain user from Local Administrator Group:

PS C:\> Remove-LocalGroupMember -Group “Administrators” -Member YourDomainName\UserName

There are many more options available using PowerShell now, if you get an error make sure to read it and see where the error is, it will give you clue and also some commands require Admin right you will get an error like Access denied



How to hide Windows updates

Windows 10 recently having many issues, here is how to hide updates that may be causing issues. Windows 10 updates install automatically by default and it also updates some drivers, which may cause an issue with your device or application. The First thing to do is check to see if you have any updates pending if so update it and see if your issues are fixed. If your issues are not fixed then you want to try uninstalling the recent update. After uninstalling the recent update and restarting your computer fixes the issue you can hide that update so Windows 10 doesn’t automatically try the install again. Here is how to hide the updates, so it does not re-install. You should still try to update windows updates to protect your computers, not all updates causing issues.

You will need to Download the “Show or hide updates” troubleshooter package from the (no longer available via Microsoft website), then follow the instructions, I am going to show you one of the updates that are causing issues with Start Menu and Microsoft Edge on some computers. Once you have downloaded the Show and hide update package, run it and click Next

it will scan for issues

Then give you options to Hide updates or Show hidden updates, click on hide update

Select the update you want to hide, and click Next

You should see Troubleshooting has completed, click Close

That’s it, if you need to unhide it, you can following the same process, just have to click on Show hidden updates in earlier step then you will be able to install that update. I hope this helps out some users who are having issues with Windows updates.



How to Disable Touch Screen

There are cases when you want to disable the touch screen when using some application that may cause issues or just you are not using it. You will need to be an administrator to make changes, otherwise, you will get a message, you don’t have rights. Here is how to do disabled, make sure you have another source of input, like external keyboard/mouse, otherwise you will not be able to use your device.

Open Device Manger by going to control panel or just search for device manager

Then expand the Device Manager>Human Interface Devices>Right click on the HID-compliant touch screen and select Disable device

You will get warning message box: Do you really want to disable it? Click Yes Make sure you have external keyboard or mouse, otherwise you will not be able to use your device at all.

That’s it, if you want to re-enable it, just right click on it and it will give you Enable device option



Install XAMPP on Windows 10

XAMPP is very popular many people use for the building, testing application on your local system. It includes MariaDB, PHP, Perl and options for FileZilla, Tomcat, etc… Its free open source, very easy to setup and use. It can be installed on Windows, Linux, and OS X. I am using Windows 10 Pro, I will go through the install and list some issues/ how to fix issues. You can use Bitnami Application to install ready to use applications. It’s well trusted over 1 million applications per month, you can use to install from your local installers, single VMs, multi-tier VMs, container images or Kubernetes Helm charts.

Installation of XAMPP

You can download: https://www.apachefriends.org/download.html
Once you have downloaded the XAMPP, open the installation to start installing, the default location is C:\xampp noted if you install inside of the Program File you might have an issue with permission

I am going to install on default location c:\xampp, click Next

Then it will ask you which components you want to install, select one you like and then click Next

Then it will give you installation location choice, please choose and then click Next

Then click Next (if you want to learn more about Bitnami, you can have it checked otherwise unchecked)

Ready to Install, click Next

Now, it’s going to install whatever you have selected in above choices of the component, then you will see finished screen. That’s it you can start using it.

First time you will get option to select the Language, select it and click Save In case you need to change after you can go to XAMPP Control Panel>Config>Change Language

Then you should see the XAMPP Control Panel, here you can start using, default requirements web server and database, I am going to use Apache and MySQL. You might see error, ports in use, I will list below on fix.

Common Issues/Fixes

Apache port in use: open Config>Service and Port Settings>Apache
Change ports that are not in use both Main and SSL port

You might also need to change MySQL port, default is 3306

Once you have thing running and see any error, you can check out the logs for Apache and PHP, which will give you more details.




Clean up Windows 10 updates

Microsoft Windows 10 updates are trying it’s best to keep the user system protected, but user system drives are loosing about 5 GB-30 GB of their hard drive space. If you have a smaller drive and need to clean up Windows updates, you can by deleting old system files. You can also clean up old programs you no longer need and empty out recycle bin.

Here is example of about 100 GB drive and 35 GB taking up by Windows, it’s not all Windows update

How to clean up system files

Open Windows Explorer and right click on the system drive (normal default C drive), then select Properties (or you can search for “disk cleanup” or type in run command:cleanmgr.exe )

Then click on Disk clean up

Then click on Clean up system files

Then select the check box Windows update Cleanup then click on ok, that should give you back your hard disk space.

Here is couple different computer Windows 10 update clean up about 6 GB to 10 GB

That’s it, there are other check boxes you can check off to clean up more. You can click on each one it will give you more information about it, most if not all can be checked and clean out, unless you want for logs or recover your system.