Example #1
0
        public bool MoveUser(string userDistinguishedName, string newContainer)
        {
            var wasSuccessful = false;

            if (userDistinguishedName == null)
            {
                return(wasSuccessful);
            }
            if (newContainer == null)
            {
                return(wasSuccessful);
            }

            var request = new MoveUserRequest()
            {
                NewContainer          = newContainer,
                UserDistinguishedName = userDistinguishedName
            };

            var response = _usersClient.PostAsJsonAsync($"{_usersUri}/move", request).Result;

            response.EnsureSuccessStatusCode();

            return(response.Content.ReadAsAsync <bool>().Result);
        }
Example #2
0
 public IHttpActionResult PostMoveUser(MoveUserRequest request)
 {
     return(Ok(_userSvc.MoveUser(request.UserDistinguishedName, request.NewContainer)));
 }