Use rpccli_samr_OpenDomain() all over the place.