How to delete Active Directory user with privilege issue

There may be a number of reasons you can’t delete some users from Active Directory, one of them could be domain admin or enterprise admin privileges. Another could be some objects are still in use or not sync up with an exchange, they both have some many references, so can’t delete active directory user with exchange ActiveSync

I had come across one after migration to Office 365, some user account that may have old Exchange attributes that cannot be deleted and you will have to manually give your self full access. here is how to delete those account that has privilege issues.

First you need to change the view to: use the “view -> users, Contacts, Groups, and Computers as containers”

Then go to the user you are having issue deleting, give you self full permission to object then you should be able to delete it



How to extend your screen to the second monitor

Display Rearrange your displays

It’s very common these days people are working from home and doing multiple tasks so they use the second monitor. The second monitor could be attaching directly to a laptop, desktop, tablet, or wirelessly. Some devices have built-in options some you have to use an adaptor, converter, or external docking station. Here are some options and settings to help you extend your screen to the second monitor.

Types of connections:

VGA, HDMI, DVI, min HDMI, micro HDMI, Type-C you can do a search on the specific type to get a picture if you don’t know what these are. There are so many others but these are common.

On Windows 10 computer:

Once you have your second screen connected or ready to connect if using wirelessly.

Click Notification icon near the bottom clock
Then click on Project
Click on Extend (if using a wireless click on Connect to a wireless display)
you should see now both screen

on Windows 10 Connecting to Wireless display

Click Notification icon near the bottom clock
Then click on Project
Click on Connect to a wireless display
It will give you options to choose your wireless display, some have code you need to enter some devices just connects. then you should see both screens

Some settings you should know:

Display resolution, higher the resolution clear the image, but texts and windows will get smaller. You can also use Scale (zoom) some apps may not display correctly. Every display has it’s own settings you can change that works for you, just look around for options.

If you need to change the way the arrow mouses from one screen to another, you can just rearrange the displays and so your mouse pointer moves the monitor way you have physically. If you don’t know you can click on Identify it will display 1 and 2.

If you need to make the second monitor as primary, so any application you open will open by default on the second monitor.

Select second monitor then under Multiple displays, check the box Make this my main display

That’s it, there are so many other settings you can look around to find what works for you, also based on the selection and type of device you will see more options.



How to setup Kiosk using Raspberry Pi 4

There are many open-source and paid versions out there to set up kiosks.  I have set this up on Raspberry Pi version 1, 2, 3, and now 4.  It’s a very simple setup, I am going to set the website URL default to loading when Raspberry Pi 4 boots up, but you can change it to whatever you like, it could be a slide show, video, etc.….  You can even use it as Signage, there are some others out there that are better for Signage so it gives you preconfigured.

What you will need:

  • Raspberry Pi 4 (you can use an older version too, your settings may be different)
  • SD memory card 8GB or larger
  • Network connection LAN or WiFi
  • Terminal to SSH to Raspberry or run the command on the Raspberry
  • Unzip program and image burner software

Sections:

Update Raspberry Pi 4

Create a script file

Adding script file to auto-start when Raspberry Pi boots up

Enable SSH

common issues and solutions:

Download the “Raspbian Buster with desktop” or if you want the one with an application you can do so as well it’s Raspbian Buster with desktop and recommended software image, then you will need to unzip the download file.  If your computer doesn’t have the unzip program you can download the 7zip from https://www.7-zip.org/download.html

Next, you will need the image burner software, if you have one use it or download this one https://www.balena.io/etcher/, it supports many operating systems including Windows, Linux, macOS, and Portable.  Or https://sourceforge.net/projects/win32diskimager/ it’s a little outdated, but still works.

Download Raspbian Buster with desktop: https://www.raspberrypi.org/downloads/raspbian/

Once you have downloaded and used one of the image burner software to burn into SD card, then put in the Raspberry Pi 4 and start it up and if everything goes well you should see, click Next to go through basic settings

Welcome to Raspberry Pi

Set your local Country, Language and Timezone, then click Next

Set Country, Language and Timezone

Change Default Password, enter new password and click Next

Change Default password

Setup up screen settings, You may need this to enable or disabled, click Next

Set Up Screen

Select WiFi Network or click skip

Select WiFi Network

Update Software, you can skip or let it search and install

Update Software

Running very good even while searching for updates, see Task Manger

Task Manager

Once it’s finished searching, installing new updates or if you skipped you will see option to restart, click restart so all settings takes effects

Setup Complete

Once the Raspberry Pi 4 restarts, open the Chromium once so it creates the Default/Preferences automatic, then just close it

Update the Raspberry Pi 4:

sudo apt update && sudo apt upgrade

Create a script file:

Now setting up the script file, you can name it whatever you like: example StartApp.sh, inside copy and paste this code and change the URL to whatever you like

!/bin/bash
# If Chromium crashes (usually due to rebooting), clear the crash flag so we don't have the annoying warning bar
# waits for 10 seconds before opening URL
# To disable screen saver timeout
xset s 0
# To disabled Monitor going to sleep
xset -dpms
# clean up if the power or ssh in and poweroff or if hostname changes
rm -rf ~/.config/chromium/Singleton*
# Waits for 10 seconds before starting up
sleep 10
# Make sure to change the user name if it's not default pi
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/'  /home/pi/ .config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/'  /home/pi/.config/chromium/Default/Preferences
chromium-browser --kiosk --disable-restore-session-state --disable-session-crashed-bubble --noerrordialogs --disable-infobars http://YourURL.com

You can add other options –no-default-browser-check –no-first-run that you like to prevent from pop up

Now make the .sh file executable:

chmod +x name_of_file.sh

Adding script file to auto-start when Raspberry Pi boots up

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

@lxpanel –profile LXDE-pi
@pcmanfm –desktop –profile LXDE-pi
@xscreensaver -no-splash
# add the following, if your script file located other location then the root of the user, then you will need to put the path

sh StartAuto.sh

autostart

Other setting you may need to change so it runs smooth, without any issue:

If you want to enable SSH, so you can make changes via Remote:

sudo systemctl enable ssh
sudo systemctl start ssh

That’s it

common issues and solutions:

To remove the Mouse pointer:
sudo apt-get install unclutter

Preventing Sleep of Monitor:
it’s already included in the script file, but just in case you need to change it
sudo nano /etc/lightdm/lightdm.conf
In that file, look for:
[SeatDefault] or [Seat:*]
#uncomment and insert -s 0 dpms:
xserver-command=X -s 0 dpms

If you need to fill your screen, you will need to disable the Overscan:
raspi-config
once it loads, choose Advanced Options> Next, choose Overscan:

To Disable chromium update message:
sudo touch /etc/chromium-browser/customizations/01-disable-update-check;echo CHROMIUM_FLAGS=\”\${CHROMIUM_FLAGS} –check-for-update-interval=31536000\” | sudo tee /etc/chromium-browser/customizations/01-disable-update-check

To check the monitor resolution settings currently set to:

/opt/vc/bin/tvservice -s
Should display something like this:
state 0xa [HDMI CUSTOM RGB lim 16:9], 1920×1080 @ 60.00Hz, progressive

To check what’s available settings for your monitor:

/opt/vc/bin/tvservice -m DMT
You should see something like this:
Group DMT has 12 modes:
mode 4: 640×480 @ 60Hz 4:3, clock:25MHz progressive
mode 5: 640×480 @ 72Hz 4:3, clock:31MHz progressive
mode 6: 640×480 @ 75Hz 4:3, clock:31MHz progressive
mode 8: 800×600 @ 56Hz 4:3, clock:36MHz progressive
mode 9: 800×600 @ 60Hz 4:3, clock:40MHz progressive
mode 10: 800×600 @ 72Hz 4:3, clock:50MHz progressive
mode 11: 800×600 @ 75Hz 4:3, clock:49MHz progressive
mode 16: 1024×768 @ 60Hz 4:3, clock:65MHz progressive
mode 17: 1024×768 @ 70Hz 4:3, clock:75MHz progressive
mode 18: 1024×768 @ 75Hz 4:3, clock:78MHz progressive
mode 35: 1280×1024 @ 60Hz 5:4, clock:108MHz progressive
mode 39: 1360×768 @ 60Hz 16:9, clock:85MHz progressive

Or
/opt/vc/bin/tvservice -m CEA
You should see something like this:
Group CEA has 10 modes:
mode 1: 640×480 @ 60Hz 4:3, clock:25MHz progressive
mode 2: 720×480 @ 60Hz 4:3, clock:27MHz progressive
mode 3: 720×480 @ 60Hz 16:9, clock:27MHz progressive
mode 4: 1280×720 @ 60Hz 16:9, clock:74MHz progressive
mode 5: 1920×1080 @ 60Hz 16:9, clock:74MHz interlaced
mode 6: 720×480 @ 60Hz 4:3, clock:27MHz x2 interlaced
mode 7: 720×480 @ 60Hz 16:9, clock:27MHz x2 interlaced
(prefer) mode 16: 1920×1080 @ 60Hz 16:9, clock:148MHz progressive
mode 32: 1920×1080 @ 24Hz 16:9, clock:74MHz progressive
mode 34: 1920×1080 @ 30Hz 16:9, clock:74MHz progressive



How to upgrade Ubuntu 16.04 to 18.04

It’s always best to stay up to date with technologies that you are using these days, due to lots of data getting hacked because they are not updated.  I had written a post earlier on how to upgrade Ubuntu 14.04 to 16.04, the process is the same. Make sure you have a good backup and your backup is tested to be sure data you are backup are good. If you have an option you can do an upgrade on a test server and work out any issues, that way when you do upgrade on the production system it goes smooth.

Check list before starting upgrade process

  • Data backed up and verified, which includes configs, PHP, Databases, etc…
  • Make sure your application supports newer packages versions
  • List of application/services so it can be tested after the upgrade
  • Direct access to the server, remote session will give you an error
  • Stopping application/services, not required but if dealing with a database it’s safer
  • Double-check storage space for an upgrade to download/install, you will need about 10GB

To get list of packages:

dpkg -l | grep php | tee packages.txt

Current supported Ubuntu version: https://wiki.ubuntu.com/Releases

Login to the server directly to do the upgrade, also before the upgrade make sure you are up to date and don’t have any issues with your server or resources.

You can run following commands to check for any updates:

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade

To start the upgrade process

Run the following command it will go through a check of currently installed packages and give you the option to check and make sure you are ok to start to upgrade.  You should check and make sure your application support new version, so it does not break your application after the upgrade. You can press d to get detailed list, when done press q and it will bring you back to option to Continue or N to cancel. Press y and Enter when you ready

sudo do-release-upgrade

If you have apache installed you will get this prompt, which you can select option best fit your needs.

If you get option for sshd_config, select keep the local version currently installed

It will scan for any obsolete software and will give you option to remove it

Once that done, then it will ask to restart the server press y and Enter

Once the server comes back you should see Ubuntu 18.04.x

Total size was about 10.5 GB and it took about 2 hours, yours may be different based on server resources, an application installed, etc…

common issues and solutions:

Very common if you are using web server you might have issue with PHP:
To check PHP version: php -v

Re-enable PHP, if upgrade from older version:

sudo a2enmod php7.2
sudo service apache2 restart

To install full PHP packages you can run following command:

sudo apt install php php-cgi libapache2-mod-php php-common php-pear php-mbstring

If you run the upgrade via SSH session you will get this message, which is not recommended:

Find all PHP version installed on your system:

dpkg -l | grep ‘\(php\)’
or
php -i | grep ‘php.ini’
or
php -i | grep ‘Configuration File’

Find all mysql version installed:

dpkg -l | grep ‘(mysql)’

How to remove old PHP version:

Before running this command, make sure you have backup of your php.ini or any custom changes did. This command will wipe out everything
Sudo apt purge php5*



How to recover offline Ubiquiti Unifi cloud key Controller

For whatever the reason your Unifi cloud key goes offline or after the firmware upgrade it shows offline, then you will lose access to UniFi Management Dashboard https://unifi.ubnt.com. This happens when there are firmware updates that corrupted, network issues, config changes or just got stuck after normal re-boot. I have helped a few small businesses with this issue. Sometime re-booting fixes the issues, but sometimes it does not. So here is what I end up doing to get back online, without waiting for their “UniFi 24/7 live tech support” because it takes a long time depending on the time of the day, I had to wait between 30 minutes to up to 2 hours one time. Worse if you re-fresh browser it may kick you out and will have to restart session again. So here is what I have done it may help out some users.

Few things you should know, one you should have a backup of configuration if you don’t and for some reason, if you have still had access to cloud key via browser, ssh then download the backup to your local computer. The process I am using here sometimes it picks up auto backup and sometimes it does not. Next, make sure you are on the same network as the cloud key and other Unifi devices. The third thing you may need to use the UniFi discovery plugin, I am using within Google chrome, which helps find the Cloud key IP in case it’s changed, not required since you can find via DHCP server or smart switch or router would have MAC/IP info.

Backups: location of autobackup is /data/autobackup

Google Chrome Plugin: Ubiquity Device Discovery Tool

Here is the start of the process, if you have access to the device via browser or ssh, then do a factory reset. Otherwise, do hard reset using a paper clip small hole on the key, Hold for five seconds or so until it’s restarting then release it, which is reset to default state.

Option 1: via GUI web browser

go to IP address of cloud key and login with your user/password or default should be (user: ubnt and password: ubnt).  Once logged in click on Maintenance>Reset To Defaults

Option 2: via SSH

Login then run command: ubnt-systool reset2defaults

Once you done the factory reset process using option 1, 2 or hard reset

Then login back via browser, default login user/pass:
User: ubnt
Pass: ubnt

To restore you will need to stop the UNIFI service in order to restore (you will see Restore is Grayed out since the server is running)

Once the Unifi service is stopped you can click on the Restore from auto backup or file you have on your local computer.

You will get confirm dialog, click Confirm

Once finish with restore, then you may need to start the Unifi service or it will reboot automatically

Then go to URL of your Unifi cloud key

You will have 3 options:

  • 1 Restore from the backup file
  • 2.  List backup if it detects, then you just choose
  • 3.  Configure new setup

Once you choose your restore option, just click on confirm to restore your backup

You should see “The system is being restored.  The controller will be restarted soon

Once it’s restarted and you able to log back as normal.  You can check for the upgrade and install it.

Your Ubiquiti WiFi controller should be back online on UniFi Management Dashboard https://unifi.ubnt.com hope this helps some of you are having issues.