By default, the Active Directory Powershell management tools are not installed on Windows Servers. Commandlets are instead installed when the Active Directory Domain Controller role is added. However, you can install them even without installing the role. To do so, open Server Manager and go to Add and Remove Roles and Features. Don’t add any Roles, instead skip to add features. Then open Remote Server Administration Tools and then Role Administration Tools. From there expand on AD DS and AD LDS Tools and then highlight the Active Directory Module for Windows PowerShell. Once enabled, click Next through the end of the wizard. Once the wizard is complete, open Powershell and use…
- Active Directory, Mass Deployment, Microsoft Exchange Server, Network Infrastructure, Windows Server
-
Resize Hyper-V .vhdx To Minimum Size
A really neat new feature in 2012R2 is that Hyper-V can resize a running virtual machine (.vhdx) to the smallest possible size, while the virtual machine is running. To do so, use Get-VM in PowerShell. Here, we’ll use the -Path option to define the location of our vhdx, the -ToMinimumSize option to indicate that we’d like to shrink it down as low as we can go and -AsJob so it runs in the background: Resize-VHD –Path D:\myVM.vhdx –ToMinimumSize -AsJob
-
Check It Ma, Logz For Dayz
On a Mac, I frequently use the tail command to view files as they’re being written to or in use. You can use the Get-EventLog cmdlet to view logs. The Get-EventLog cmdlet has two options I’ll point out in this article. The first is -list and -newest. The first is used to view a list of event logs, along with retention cycles for logs, log sizes, etc. Get-EventLog -list You can then take any of the log types and view information about them. To see System information: Get-EventLog System There will be too much information in many of these cases, so use the -newest option to see just the latest:…
-
Exchange Server 2010 PowerShell Mailbox Exports
Need to export mailboxes from Exchange? Hate using exmerge to do so. Gone are the days of exmerge. Well, not entirely. But welcome to the days of New-MailboxExportRequest. Much longer and cooler command than exmerge ever thought about being. C:\>New-MailboxExportRequest -Mailbox cedge -FilePath \\kryptedexchange.krypted.com\pst\cedge.pst You then receive confirmation that the export has been queued: Name Mailbox Status ---- ------- ------ MailboxExport https://krypted.com//Users/cedge... Queued To view the status, swap New with Get (Get-MailboxExportRequest): Get-MailboxExportRequest The output is as follows: Name Mailbox Status ---- ------- ------ MailboxExport https://krypted.com//Users/cedge... InProgress To get even more info, use the -Name option with Get-MailboxExportRequest, identifying the actual process name. Get-MailboxExportRequest -Name MailboxExport | fl The output…
-
Creating Users On Windows Server 2012 Using PowerShell
Scripting user creation in Windows Server is something we’ve long done using LDIF files; however, when building a system that creates users in more of a one-off capacity it’s pretty easy to script the creation process using PowerShell, piping information in from other solutions. To create a user, use the New-ADUser cmdlet. I’ve found that we usually need to populate this with a few pieces of information, including the account name (SamAccountName), the password (AccountPassword), the full name (name) enabling the account (enabled), setting the password not to expire (PasswordNeverExpires) and forcing the user to change their password when they log on (ChangePasswordAtLogon). Respectively, the following example would create user…
-
Powershell Goodies From Vexasoft
There are a number of features that make mass deployment of Mac OS X pretty easy. Some of these would be great to have in Windows. These range from systemconfiguration to networksetup and the ability to look at packages that have been installed and review their bills of material. Well, the good people at Vexasoft have built a number of Powershell libraries that, while they aren’t named as such, do a number of the features that these commands do, just for Windows clients via Powershell. And the best part is, a number of them are free. Let’s look at what some of these commands do: First, there are the cmdlets…