Register DLL or OCX file(s) & check results

I needed to register serveral OCX files and wanted to be able to check if the result was succesfull, so my automation script could continue. I found out that HKEY_CLASSES_ROOT didn't exist as a PS drive, thus it needed to be created (thank you Lior Elia for your blog post on this subject). Normally this … Continue reading Register DLL or OCX file(s) & check results

Check user credentials and set auto logon

I had several requests from the developers at our company, to enable auto logon for various servers. I knew this was possible through regedit (as explained in this Microsoft support article) Though, sometimes it needed to be done on (test) servers which reside on a domain and sometimes it needed to be done one (stand-alone) … Continue reading Check user credentials and set auto logon

How to get all remote logged on users

I wanted a simple way to get all (remote) logged on (and disconnected) users on all servers in my domain. This way it's easier for me to see if there are any disconnected sessions still open. In my case I've entered them into a SQL database, but for the example on this blog, I will … Continue reading How to get all remote logged on users

Find text (string) in text file(s)

If you want to find a certain text (string) in a text file or multiple text files, the quickest way to do so, is by using the select-string option. First you'd need to get a list of the files you want to search trough: $FileList = Get-ChildItem -Path "D:\temp\" or you can use it on … Continue reading Find text (string) in text file(s)

Writing to a SQL database

Last week I needed to store information in a SQL database, so I can share certain user account information with a select group of users in the helpdesk department, but they shouldn't have access to the AD itself. So I decided that a SQL database was the way to go and I can create a … Continue reading Writing to a SQL database

Stop/Restart/Pause OneDrive for business

I had an issue with OneDrive for business, which I need to use to be able to sync a SharePoint folder to my local machine. On this machine I like to do some auto cleanup with my MoveOldFiles script (a script that moves all files in certain folders to sub folders in the format yyyy\MM, … Continue reading Stop/Restart/Pause OneDrive for business

Create a sharepoint (document) library

Creating a sharepoint library (works in both sharepoint foundation and sharepoint server) with powershell is a nice way to ensure all libraries within sharepoint are configured the same way. What we'll be doing here, is creating a library, disable anonymous access on it and only allow certain user groups to have access rights to this … Continue reading Create a sharepoint (document) library