• Active Directory,  Windows Server

    Import And Export Active Directory Objects In Server 2012

    The LDIFDE utility exports and imports objects from and to Active Directory using the ldif format, which is kinda’ like csv when it gets really drunk and can’t stay on one line. Luckily, ldif can’t drive. Actually, each attribute/field is on a line (which allows for arrays) and an empty line starts the next record. Which can make for a pretty messy looking file the first time you look at one. The csvde command can be used to export data into the csv format instead. In it’s simplest form the ldifde command can be used to export AD objects just using a -f option to specify the location (the working…

  • 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

  • VMware,  Windows Server

    Hyper-V: Convert .vhd Files to .vhdx

    The vhdx format provides support for 2 terabyte drives, can difference dynamic disks faster and provides more options for sector sizes. When upgrading into Server 2012, you can migrate your vhd files to vhdx files using Hyper-V Manager. To do so: Open Hyper-V Manager Click on the Action pane from the Action menu Click Edit Disk… At the Edit Virtual Disk Wizard click Next Provide the name of the location for the vhf file Click Next at the Location pane Click Convert at the Choose Action pane Click Next Click the vhdx format at the Choose Disk Format Click Next until the wizard is complete You can also use the…

  • Microsoft Exchange Server,  Windows Server,  Windows XP

    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:…

  • Active Directory,  Microsoft Exchange Server,  Windows Server,  Windows XP

    Kill Processes In Windows

    You always want to stop a process gracefully. However, sometimes it’s just not possible to do so. Sometimes, you have to kill a process. Sometimes you have to end a process or a process tree when you can’t restart them gracefully. To stop a process in Linux and Mac, use the kill command. In Windows, there’s a Powershell cmdlet called Stop-Process that enables you to terminate a process. As with kill, just add the process ID at the end of the command. For example, to stop process 318: Stop-Process 318 Or you can stop based on the name of the process using the -processname option. For example, to kill a…

  • Active Directory,  cloud,  Consulting,  iPhone,  Kerio,  Mac OS X,  Mac OS X Server,  Mac Security,  Mass Deployment,  Microsoft Exchange Server,  Network Infrastructure,  Windows Server

    Dig TTL While Preparing For A Migration

    Any time doing a migration of data from one IP to another where that data has a DNS record that points users towards the data, we need to keep the amount of time it takes to repoint the record to a minimum. To see the TTL of a given record, let’s run dig using +trace, +nocmd to turn off showing the version and query options, +noall to turn off display flags, +answer to still show the answer section of my reponse and most importantly for these purposes +ttlid to toggle showing the TTL on. Here, we’ll use these to lookup the TTL for the https://krypted.com/ A record: dig +trace +nocmd…

  • Microsoft Exchange Server,  Network Infrastructure,  Windows Server

    Delete Messages From Exchange Using PowerShell

    Before I type anything else, allow me to state that running a search and deleting things with a script from a users (or a loop of all users) is a very dangerous process. However, I’ve often noticed that an outbreak of bad things can cause us to do some pretty awesome things. So, you can use the get-Mailbox cmdlet to pipe a mailbox into the search-mailbox cmdlet and from there use the -SearchQuery option to search for an attachment, following the attachment option with a filename and then delete it using the -DeleteContent option. The example would be as follows: Get-Mailbox -Identity “cedge” | Search-Mailbox -SearchQuery attachment:ichatsmileys.pkg.zip -DeleteContent You can…

  • Windows Server,  Windows XP

    Net Stats & Windows Server

    Windows Server tracks the sessions that have been authenticated into the system, those that have been timed out, those that have errored, kb sent/received, response time, errors, permission problems, password problems, files opened, print job spooling and buffers quickly and easily. Simply use the net command we’ve all been using for 20 years, followed by stats or statistics: net statistics When prompted choose server or workstation. In this case, we’ll use Server. net statistics Server Here’s the output from a new server: And if you’re trying to troubleshoot client/server communications, keep in mind that you can look at much of this on the workstation side as well, but from the…

  • Microsoft Exchange Server,  Windows Server

    Disable OWA Theme Selection In Exchange

    Outlook Web Access (OWA) allows administrators to setup themes. I’ve noticed a lot of people configuring custom OWA themes these days. And when they do, they are always annoyed when users change the theme back to the default. So, let’s disable theme selection using the set-owavirtualdirectory cmdlet. Here, we’ll do so on a server called krypted, on the default web site, for the default owa virtual directory using the -identity option. The option we’ll use is -themeselection enabled and we’ll set it to $false: set-owavirtualdirectory -identity "krypted\owa (default web site)" -themeselectionenabled $false To set it back, just swap $false for $true: set-owavirtualdirectory -identity "krypted\owa (default web site)" -themeselectionenabled $true

  • Microsoft Exchange Server,  Windows Server

    Redirecting Exchange Login Pages

    By default, when you require an SSL certificate in IIS on an Exchange server, if users hit the page without providing an https:// in front they will get an error. Rather than require certificates, it’s better in most cases to redirect unsecured traffic to a secured login page. In order to do so, first configure the redirect. To do so, open IIS Manager and click on the Default Web Site. At the bottom of the pane for the Default Web Site, click Features View if not already selected. Then open HTTP Redirect. Here, check the box for “Redirect requests to this destination” and provide the path to the owa virtual directory (e.g.…