

I personally like using PowerShell functions and cmdlets instead of. (Get-ChildItem –Path C:\Documents).Encrypt() Using PowerShell Functions to Encrypt Files But, instead of using Get-Item, you'll need to use Get-ChildItem to get all of the files from within that folder. Performing an encrypt or decrypt on an entire folder is just as easy. The act of encrypting and decrypting a file is as simple as calling an Encrypt() and Decrypt() method on a particular type of object, which can easily be obtained with Get-Item or, in the case of an entire folder(s), with Get-ChildItem.įor example, if I wanted to encrypt our example above with PowerShell, I'd only need a single line of code. Related: Developing a HTTP Script Monitor in PowerShellįortunately, Microsoft was kind to us and doesn't require a lot of scripting to make this happen. If you'd rather not spend your time encrypting them manually, there's a better way: use PowerShell.īy using a PowerShell script, you can build code that will allow you to pass any number of files or folders into it to automatically encrypt them regardless of where they are. In a business environment, you're probably going to have to encrypt an entire folder or many different folders across different locations. Select the "Encrypt contents to secure data" checkbox and apply the change to immediately encrypt the file. Click that and you'll see the option to encrypt the file. Then, in the Properties pane, you'll see an Advanced button. Right-click on the file and select Properties. Encrypt Files via the GUIįirst, you'll need to find the file you want to encrypt in Windows Explorer. Finally, I'll go over some PowerShell code that will allow you to perform this task over many different locations at once.

In this article, I'll show you how you can manually encrypt and decrypt files with EFS using the GUI. By using Microsoft's built-in Encrypting File System (EFS) technology and PowerShell, the task of encrypting and decrypting one, two or millions of files and folders across your data center can be a lot easier. Related: How to Automate 5 Repetitive IT TasksĮncrypting data is always a good idea but it can be hard to manage, especially across different servers and storage locations. But, if you had the foresight to encrypt the data on that server beforehand, while your data might still be gone, at least you'll know it won't be read. If your data is not encrypted, kiss it goodbye.

However, what if your network is breached anyway? Perhaps someone physically comes into your data center and steals a server to gather valuable data you may have stored on it. One way to do that is to ensure your network perimeter is secured to prevent any unauthorized access. As a sysadmin, it's one of your many jobs to set up security controls and make sure your network is not an easy target. Bad guys are always on the lookout for an easy score. In today's dangerous cyber environment, it's more important than ever to protect your data.
