Change mailbox language

I needed a script to set the mailbox language and also change the DefaultFolderNames to that language. This can be done by a nice one-liner Get-Mailbox "MailboxName" | Set-MailboxRegionalConfiguration -LocalizeDefaultFolderName:$true -Language 1031 -TimeZone "W. Europe Standard Time" You have to change "MailboxName" to the name of the mailbox. In this case it will change the … Continue reading Change mailbox language

Get ACLs on non-inherited folders

I needed a (nice) way to document all non-inherited ACLs (access control lists) on a folder. I wanted this to be exported as a CSV file with a delimiter of my choice. I also wanted to add a log file, in case of any error or strange behavior I could find out what, or where … Continue reading Get ACLs on non-inherited folders

Get AD RDS Profile information

I needed to get information which is located in the AD user information, which is located on the tab "Remote Dekstop Services Profile", which gives the user Profile Path, Home Folder drive and location of the Home Folder on the network (see image below). AD user RDS Profile tab I also wanted to check if … Continue reading Get AD RDS Profile information

[decimal] conversion has some unexpected behavior depending on culture settings

I ran into an issue where I had to convert a string value to decimal, to run a switch case on it. Once the systemlocale setting was set to en-US, there were no issues with the script, but when set to nl-NL (or any other country that uses a comma as seperator), it didn't work … Continue reading [decimal] conversion has some unexpected behavior depending on culture settings

SetAccessRule fails “The trust relationship between this workstation and the primary domain failed.”

I tried to change the access rights for a path and a file. But it gave me an error. Exception calling "SetAccessRule" with "1" argument(s): "The trust relationship between this workstation and the primary domain failed. The scripts I've used, were definitely working before, so the issue wasn't with the script. I used these scripts, … Continue reading SetAccessRule fails “The trust relationship between this workstation and the primary domain failed.”

Passing user credentials to a remote computer

I needed to do a remote installation on a server of software that is located on a share. I wanted to achieve this through a PSSession (from my management server), but I ran into the problem that the share wasn't accessible from the PSSession. As explained in this Microsoft article, the Enable-WSManCredSSP cmdlet enables CredSSP authentication on … Continue reading Passing user credentials to a remote computer

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