- Add user(s) to group(s) – GUII needed a script to add multiple users to multiple groups. It is a task I needed to do several times and will need to do this many more times in the future as well. So I decided to create a nice little script (with GUI) to help me and … Continue reading Add user(s) to group(s) – GUI
- Get Remote Desktop Services infoI wanted to have a way to document my Remote Dekstop Services environment (Connection broker, Session Host, Gateway, Remote Applications), thus I created a script that does just that. In case of the script I’m sharing here, this will create exports to CSV for the different items. These are the … Continue reading Get Remote Desktop Services info
- Copy AD group membersI needed to copy AD group members to another AD group, if they didn’t already exist in the target group. This is very plain and simple script you can run the script and add -SourceGroup “group name” -DestinationGroup “destination group”, or omit those and the script will ask you for … Continue reading Copy AD group members
- Exchange powershell .Value.toMB()If you run exchange powershell, you have the ability to use .Value.toMB() ie. on the ProhibitSendQuota value, or on the IssueWarningQuota, to recalculate this value to MB’s instead of bytes (and it omits the GB addition). But if you create a (remote) session to Exchange powershell, this functionality stops working. … Continue reading Exchange powershell .Value.toMB()
- Change mailbox languageI 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 … Continue reading Change mailbox language
- Get ACLs on non-inherited foldersI 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 … Continue reading Get ACLs on non-inherited folders
- Get AD RDS Profile informationI 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). I also wanted to check if … Continue reading Get AD RDS Profile information
- [decimal] conversion has some unexpected behavior depending on culture settingsI 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 … 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 … Continue reading SetAccessRule fails “The trust relationship between this workstation and the primary domain failed.”
- Passing user credentials to a remote computerI 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, … Continue reading Passing user credentials to a remote computer
- Register DLL or OCX file(s) & check resultsI 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 … Continue reading Register DLL or OCX file(s) & check results
- Copy Windows 10 lock screen imagesI had a very nice picture on my lock screen and wanted to see if I was able to save this image to my computer, which made me stumble upon this post op laptopmag.com. After seeing how I would be able to copy this image to my pictures, I wanted to … Continue reading Copy Windows 10 lock screen images
- Check user credentials and set auto logonI 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 … Continue reading Check user credentials and set auto logon
- How to get all remote logged on usersI 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 … 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 … Continue reading Find text (string) in text file(s)
- Writing to a SQL databaseLast 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 … Continue reading Writing to a SQL database
- Stop/Restart/Pause OneDrive for businessI 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 … Continue reading Stop/Restart/Pause OneDrive for business
- Open Excel file and run macroI needed a way to open an Excel file and run one of the macro’s inside the file to do some calculations and import some data then save the file as a new file, with the name of the previous month and its year added to it, to differentiate it … Continue reading Open Excel file and run macro
- Create a sharepoint (document) libraryCreating 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 … Continue reading Create a sharepoint (document) library
- Backup to zipI wanted to have a tool that creates a backup to a zip file, but I didn’t want the zip file to be recreated every time (as it can take nearly a day for some backups I wanted to make), thus I need something to synchronize to zip and remove … Continue reading Backup to zip