Export AD Objects

There must be a better way to recreate an AD domain. Enter: LDIFDE!!! – http://technet.microsoft.com/en-us/library/bb727091.aspx – http://support.microsoft.com/kb/555634 6. LDIFDE doesn’t support exporting Passwords. 7. By default “User must change password at next logon” attribute is selected, You can use this tool to manage AD objects. Immediately, I’m concerned only with exporting user objects. You need[…]

Exchange 2013 IIS applicationHost.config Corruption

This morning, one of our managed Exchange 2013 Servers stopped passing mail. Event 5172: ‘\\?\C:\Windows\system32\inetsrv\config\applicationHost.config’, line number ‘1’. The error message is: ‘Configuration file is not well-formed XML You’d receive the same message when trying to manage IIS. On the hosed Exchange server, the applicationHost.config file was 239 lines of: 2014-03-11T17:43:51.855Z,1407758,Microsoft.Exchange.RpcClientAccess.Service.exe,5352,,Search,Success,2, 0,1,1,,(&(|(objectSid=S-1-XXX)(msExchMasterAccountSid=S-1-5-XXX)(sIDHistory=S-1-5-XXX))(!( objectClass=foreignSecurityPrincipal))(!(msExchCU=*))(|(objectCategory=person)( objectCategory=msExchDynamicDistributionList)(objectCategory=group)(objectCategory=publicFolder)( objectCategory=msExchPublicMDB)(objectCategory=msExchSystemMailbox)([…]

Custom Filter for Jinja Templates

You may have noticed, prior to this, my blog posts have looked like a wall of text. That’s because Jinja (Templating engine) was stipping newlines. To resolve this issue, use a custom filter: def BlogPostFilter(value): return value.replace(‘\n’,’\n’) app.jinja_env.filters[‘BlogPostFilter’] = BlogPostFilter {{ blogPost.body | BlogPostFilter }} … I still need to work on whitespace to get[…]

Unicode of DOOOM!!

So I have this great system to automatically update the blog from a list of files when I click a button. Of course it broke while bringing in the latest post about Hyper-V – UNICODE!!! Solution was to decode when reading in from file: with open(blogpost, ‘r’) as bp: body = bp.read().decode(‘utf-8’)