1

I'm writing a user data synchronization service in go, which is supposed to consume CSV and XML files containing user data from customers. The CSV part is pretty straight-forward.

Concerning XML, I'd like to require that customers conform to a pretty specific XML schema while not requiring them to do custom coding or whatnot on their end. So, I'm looking at which tools are available in (or for) all Windows Server editions to generate something that I can consistently read (probably excluding WS 2003, as AFAICT you're stuck with CSV or LDIF exports here (I know WS 2003 is EOL'ed, but the customer is always right, even when they're wrong)).

Scouring Google there are lots of examples of VB and PS scripting to do custom AD exports, but (not being a Windows user myself — let alone Windows Server admin) I get the feeling that more often than not the need for such scripting may arise from having very specific needs, and I'm wondering if there aren't standardized Microsofty ways of dumping XML data from Active Directory that would be easier for a customer to use and sufficient for my needs.

Thanks in advance, Daniel

1 Answers1

0

Powershell will output to XML, but that's not a common way for Windows to handle user account imports and exports. You've already mentioned the common native data formats - CSV and LDIF.

I have no idea why you're choosing one of your data formats to not be the common ones for AD import/export. The path of least resistance is to use the native features. To go another route is typically going to involve some significant amount of coding on your end to handle.

But hey, as long as you're excluding Win2k3, you can just use Get-ADUser -properties * | Export-Clixml for the customer side of things. /Edit - actually, that's got some painful potential, as some of what Get-ADUser returns are PS objects that you'll need to expand or otherwise handle, and a given customer's AD schema may not match what you expect. Again, this is what you're signing up to deal with by not going with the native tools. Best of luck.

mfinni
  • 36,144
  • 4
  • 53
  • 86
  • Thanks, mfinni. I'm not in a supreme position to choose, so I was looking at options based on the data we've historically received from clients, which for some has been XML. Hence the question if there was any sort of standard way to do this on a Windows server. Your response supports the impression I've been getting that XML output is *not* standardized, and that pain will ensue from going that route, and that really helps as I want to argue for requiring customers to deliver CSV files. XML has an advantage with charsets, but I'd rather handle CSV encodings than write support for random XML. – DanielSmedegaardBuus Apr 11 '16 at 10:05