Aministrator Powershell scripts

In the old days it was only the *Nix admin that was working with the command line.
Microsoft has in the mean time modified almost all there programs to fully support powershell. Even better the UI executes powershell code when you modify or create something.

Ofcourse you can’t know it all and searching the big and mighty google helps you along, therefor I decided to centralise my powershell scripts that collected or wrote on Github.

And ofcourse I will gladly share them with everyone. You can find the Git page at

The overview is as followed:

scriptname explanation
Cleartempfolders.ps1 Clears the temp folders on local srv / pc
Get-ADRecursiveGroupMembership.ps1 lists all the user his groupmemberships
O365_User_Group.ps1 lists all the O365 groups and their users, used for CSV export
O365_search_alias.ps1 searches O365 mailboxes for an defined alias
check_ad_trustrelationship.ps1 searches for clients with failed trust relationships
connecto365.ps1 connect to O365 powershell
lync_assigned_numbers.ps1 creates an html file with all assigned numbers in Lync server
ping_many2many.ps1 ping test from multiple servers to multiple servers
resetadpassword.ps1 reset AD user his password
send_notification.ps1 send a notification to remote computer
unlock_all_ad_users.ps1 unlock all locked domain users
unmount-esx.ps1 unmount all ISO’s from VM on Vsphere / ESX
user_leaves.ps1 reset password, disable user, move to ou and convert mailbox to shared mailbox for leaving user
w10_likeitshouldbe.ps1 modification to W10 to fit in an enterprise (disable telemetry, uninstall games, apps …)

OpenSSL update on Linux – Heartbleed

The heartbleed bug caused a fair bit of commotion in the web hosting sector, if you don’t know about the heartbleed bug I would suggest you go to and read up first. Now the solution to the bug is quite simple, you just need to update your OpenSSL implementation to the latest version. Because every Linux OS is different I will explain the different steps you need to undertake.

Ubuntu 12.04/12.10/13.04/13.10 and Debian 7

CentOS 6.x

CentOS 6.x with DirectAdmin

CentOS 6.x with Cpanel

Do not forget to reboot afterwards, this step is quite important, so that the services are restarted and are using the latest OpenSSL stack.

Good luck

Joomla Error 28 from storage engine SQL

A not so documented error that Joomla sites can have is error 28 from storage engine sql.Due to this error it isn’t possible to create new MySQL connections and your website will display multiple error messages displaying this error.

The problem and resolution lays in the hands of the webhoster or system engineer.
Joomla uses the /tmp folder to create a file every time a MySQL connection is established. Now this folder can run out of space or the maximum number of files / folder is reached.

The resolution is then quite simpel, clean out the /tmp folder. You can do this with the following command

If you want you schedule a cron job to do this on for example a weekly basis.

Open the cron editor

And add the following line

Close and save the file

Ubuntu Remote Desktop Client – Black cursor on 2008 R2 & Win 7

From Ubuntu 8.04 there is a bug that makes your cursor black when using a remote desktop (rdesktop) to a session on a Windows server 2008 R2 or Windows 7. This can be solved by adding the patch repo and updating your software.

or when not installed