Exemplo n.º 1
0
        /// <summary>
        /// Gets a connector space object
        /// </summary>
        /// <param name="id">The ID of the connector space object</param>
        /// <returns>A connector space object</returns>
        internal static CSObject GetCSObject(Guid id)
        {
            XmlNode node = CSObject.GetCSObjectXml(id);

            if (node != null)
            {
                return(new CSObject(node));
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Changes the password for a connector space object
        /// </summary>
        /// <param name="oldPassword">The user's old password</param>
        /// <param name="newPassword">The user's new password</param>
        public void ChangePassword(string oldPassword, string newPassword)
        {
            ManagementObject mo = CSObject.GetWmiObject(this.ID);

            string result = mo.InvokeMethod("ChangePassword", new object[] { oldPassword, newPassword }) as string;

            if (result == "access-denied")
            {
                throw new UnauthorizedAccessException();
            }
            else if (result != "success")
            {
                throw new MiiserverException($"The operation returned {result}");
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Sets the password for the connector space object
        /// </summary>
        /// <param name="password">The password to set</param>
        /// <param name="forceChangeAtLogin">A value that indicates whether the password should be changed at the next login</param>
        /// <param name="unlockAccount">A value that indicates whether the account should be unlocked</param>
        /// <param name="enforcePasswordPolicy">A value that indicates whether the password policy should be enforced</param>
        public void SetPassword(string password, bool forceChangeAtLogin, bool unlockAccount, bool enforcePasswordPolicy)
        {
            ManagementObject mo = CSObject.GetWmiObject(this.ID);

            string result = mo.InvokeMethod("SetPassword", new object[] { password, forceChangeAtLogin, unlockAccount, enforcePasswordPolicy }) as string;

            if (result == "access-denied")
            {
                throw new UnauthorizedAccessException();
            }
            else if (result != "success")
            {
                throw new MiiserverException($"The operation returned {result}");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Reloads the connector space object from the metadirectory
        /// </summary>
        public void Refresh()
        {
            XmlNode node = CSObject.GetCSObjectXml(this.ID);

            this.Reload(node);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Gets the connector space objects connected to the specified metaverse object
 /// </summary>
 /// <param name="mvObjectId">The ID of the metaverse object</param>
 /// <returns>An enumeration of connector space objects</returns>
 public static IEnumerable <CSObject> GetConnectedCSObjects(Guid mvObjectId)
 {
     return(CSObject.GetConnectedCSObjectLinks(mvObjectId).Select(link => link.GetCSObject()));
 }
Exemplo n.º 6
0
 public CSObject GetCSObject(Guid id)
 {
     return(CSObject.GetCSObject(id));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Gets the connector space object referenced by this link
 /// </summary>
 /// <returns></returns>
 public CSObject GetCSObject()
 {
     return(CSObject.GetCSObject(this.ConnectorSpaceID));
 }
Exemplo n.º 8
0
 public CSObject GetCSObject()
 {
     return(CSObject.GetCSObject(this.ID));
 }