Automating account creation

Is there a way to automate spark account creation? Or even link it to active directory?

What do you meant by automation?

One can integrate Openfire with AD, so in a client (Spark or other xmpp client) user would input his AD credentials to login. One can also enable SSO in Spark, so it would automatically login with AD user. SSO can be tricky though.