Need to get a list of users in your domain? Or perhaps an inventory list of computers, or security groups? PowerShell is your friend! 🤝 Requirements and installation For first time and one-time setup you need to do the following: Download Remote Server Administration Tools for Windows 10 from Microsoft and install it. Make sure you choose the one appropriate for your operating system. In Windows run OptionalFeatures.exe and turn on Remote Server Administration Tools. In PowerShell you will have to run Import-Module ActiveDirectory. Usage Here are some common use cases. If you want more you can check out the official documentation. Export all users in AD with all attributes to a csv file. Make sure you Set-Location -Path or cd to the export path first. Export users of a specific organizational unit: If your domain is adatum.local then you should write DC=adatum,DC=local. For some strange reason the list of OU’s and DCs must be listed in a reverse order like this: But we could make it tidier by setting the list of OU and DC as variables. We can also make a variable with attributes. This makes it easier to change or adapt the script to different tasks. Export users that are actually human employees A lot of times you might have some service-accounts, test accounts or similar. If you just want to export a list of actual employees you can filter the results by using any attribute such as the employee number or employeeID. Get all disabled users that have an employee number Export memberships of users with employee number Find all employees with employee number and export their respective memberships to individual text files. Export all attributes of users with employee number Find all employees with employee number and export their all their respective attributes to individual […]
Solution 1: Use Lenovo SmartFind website You can use Lenovo SmartFind to find compatible accessories easily. All you need to know is the machine “type number“. For example, a ThinkPad T580 may have a machine type of 20L9 or 20LA. You can find the type number by running the command: wmic baseboard get product and note the first four letters/numbers. Solution 2: Use lenovo.com website You can also use the link below and replace XXXXXXXXXX with the model number e.g 20J6003GMX. This will take you directly to all compatible parts for that particular type of computer you have. If that doesn’t work, you can go to https://www3.lenovo.com/us/en/search and search for any PC. Solution 3: Use the OCM spreadsheet Although this method might not always be up to date, you can use a spreadsheet called “Accessories and Options Compatibility Matrix (OCM)” from Lenovo. It is basically a huge spreadsheet document that contains a matrix of all compatible products. It is not very user friendly, but this table includes detailed info and comments from Lenovo. Great for IT employees that need to know specifications, FRU, and so on… Understanding Lenovo model numbers and letters It can be a little tricky to navigate the jungle of Lenovo products if you do not know your way around. Here is an infographic on how to understand how Lenovo PC names. Yeah… I am not sure about that last one, MX, but I believe it has something to do with which region in which the product is distributed or produced.
The PowerShell way of changing the display language of a shared mailbox in Office 365/Exchange Online.
Here are a few ways you can get a list of files and folders on a computer. I won’t get into specifics on how to use them. I just wanted to give you the options. 😇 The DIR command (Simple way to list files and folders) Documentation: Microsoft Docs Articles: How-To Geek, SS64, Computer Hope, windows-commandline Advantages: Good if you just need list of files, types, sizes etc… Disadvantages: Not good if you need a visual representation of the file hierarchy. GUI Alternative: JR Directory Printer does pretty much the same with a GUI. Karen’s Directory Printer offers a little more options, but it is not portable. There is also DirLister that can export to Excel and other formats, but it is buggy and adds annoying text after each file/folder. TREE command (Make a directory structure tree) Documentation: Microsoft Docs Articles: SS64, Computer Hope Advantages: Very simple and limited. Good if you just need a tree of the directory structure Disadvantages: Not good if you just need a list of files, advanced filtering or if you need something more visually pleasing. Snap2HTML (Software to make dynamic HTML) Documentation: GitHub Download: Snap2HTML Advantages: A beautiful and eloquent way to share complex directory structures with other non-technical people. Also, the software is portable, free and allows you to export to CSV or JSON. Disadvantages: Requires HTML and a web browser. The template looks a bit outdated, but you can change it if you know HTML.
What is Bvckup 2? Bvckup 2 is a lightweight and versatile Windows premium backup software. I have used it for some years now and it really is superb. The only feature I am missing is “version control”. Especially when you are editing the same file over and over. You really need to be able to go back in time sometimes. What is version control? File control, file versioning, file history, version control – are all different names for what is commonly known as “Versioning file system”. Let’s say you do not have version control. Without “version control” (a.k.a file history) you would backup a file, and every time the original file is changed, the backup gets overwritten by the latest change. So, for example, if you are working on a document and you realize you have accidentally deleted 10 pages in the document. You check your backup… and HEY! You have a backup file, great! 😃👍 But hold on… That backup is also missing 10 pages, because the backup was made recently. Noooooooooooo! 😲😖 That is exactly why you need version control (not backup)! With backup you will only have the most recent backup. With version control you will have multiple backup versions. Mac users are probably laughing right now because they have Time Machine for years. Let’s hope Microsoft is catching up soon. And I don’t mean the horrible implementation of file history, because it cant be trusted at all. How to enable version control Bvckup 2 actually has a “hidden” feature in Bvckup 2 called archive\_modified which enables file versioning. 😲🙀 This feature allows you to keep all versions of a backed-up file. Every time the file is backed up, the older version of the file is moved to a folder called $Archive (Bvckup 2). Make a new […]
Underscores is a great framework for building WordPress themes. Since the HTML markup can be a little confusing at start, I have made a simple go-to explanation for future projects. The markup might change in the future, but the basic markup has stayed the same for the last years. This markup is from April 2018. Here is a visual illustration of the markup: Here is the same markup in code: So what is going on here? Let’s break it down a little… The body contains the #page DIV which acts as a container for the whole shebang. Inside the #page the site is divided into three parts: .site-header, .site-content and .site-footer. .site-content is basically everything that goes between the header and the footer. In other words; the content. Inside the .site-content DIV we have #primary and #secondary, which are basically just a way of separating the widgets section from the main content. Inside #primary we have another div called #main. I am not completely sure why we have this div yet, but it might function as a way to add padding, margin or max-width to a centered content. Inside #main we get the single post/artigle/page, the post-navigation (previous/next post) and the comments area each in their respectiv divs.
Language settings in Windows 10 is a little more complicated than just setting the display language and keyboard input. Let me explain further. Region settings The region settings control a number of things. If you change the language here, you will also change “cultural” properties such as date format, currency, number formatting and so on. These settings are linked together with the region language. That means you can’t have English display language and Danish currency and time format. Because if you change the region to English you will also get English cultural settings. 😲 Stupid right? Note: this behavior may have changed in Windows 10 1903, but I have not tested this thoroughly. This is super frustrating for those who would like to have Windows in English, but different region settings. The solution is a simple PowerShell command: As the documentation says, this disables the action of dynamically setting the “culture” for the current user based on changes to the Windows display language. So now you can set the region in one of two ways. You can either set the region with the cmdlet: or you can edit the region language in Control Panel – > Region. Display language and keyboard language In Windows 10 there is also something called “language lists“. Languages in Windows 10 can be a little more complicated than just setting the right display language and keyboard language. I mean, if you think about it… Switzerland, for example, has four national languages; German, French, Italian and Romansh. People living in the cities Canton of Valais, Fribourg, and Bern are bilingual (speaking French and German), while Canton Graubünden is trilingual (German, Romansh and Italian). So what language settings would you use in Switzerland? My point here is that although you may have one main language, you might […]
In short, there is no simple way to remove automapping from a shared mailbox in Office 365 unfortunately. But there is a more tedious way 😉 First remove the user from the mailbox, then re-add the user without automapping enabled. Fire up PowerShell and connect to your Office 365 tenant with: Remove the user from the shared mailbox delegation: Remove-MailboxPermission -Identity shared.mail@example.com -User user.mail@example.com -AccessRights FullAccess Then add the user to the shared mailbox delegation again, without automapping: Add-MailboxPermission -Identity shared.mail@example.com -User user.mail@example.com -AccessRight FullAccess -InheritanceType All -Automapping $false If you need to give the user send as permission too you can do: Sources: https://support.microsoft.com/en-us/help/2646504/how-to-remove-automapping-for-a-shared-mailbox-in-office-365
Add an admin account with password “123abc”: Make the account administrator: Add a domain user to the domain administrator group Activate the hidden administrator account: Change password for the hidden administrator account Activate the guest user account: Create a new user without a password: Change the password of a user: Delete a user account You will have to manually delete the user folder after deleting the account.
A lot of python libraries are more often updated on GitHub than in the “Python Package Index”. So if you want to get the latest of the greatest Python repository you should install Python packages directly from Github instead of PyPi. First, you need to install Git and then add it to PATH, if you are running Windows. Then simply install any Python package from GitHub like so: Of course, you will have to replace https://github.com/rg3/youtube-dl.git with the location of your package.
This batch script will add the option to open any file or folder with Sublime Text 3 to the context menu in Windows Explorer. Alternative 1: Batch file Just replace the path C:\Portable\sublimetext\sublime_text.exe with the path to your sublime_text.exe, save…
You can use these commands to run certain Windows settings directly from either Run or Start just by typing them in and hitting Enter. Super handy if you are working with a Windows installation in a foreign language 😉 Function…