Example #1
0
        public void OpenStore()
        {
            UInt32 storeHandle = 0;
            var    result      = VMCertStoreAdaptor.VmAfdOpenCertStore(ServerName, 0, out storeHandle);

            VMAfdClientError.Check(result);
        }
Example #2
0
        public void CloseStore()
        {
            UInt32 storeHandle = 0;
            var    result      = VMCertStoreAdaptor.VmAfdCloseCertStore(ServerName, storeHandle);

            VMAfdClientError.Check(result);
        }
Example #3
0
        public Dictionary <string, string> GetProperties()
        {
            var props = new Dictionary <string, string> ();

            foreach (var propEntry in VMAfdPropertyDef.PropDefs)
            {
                try {
                    string value = "";
                    if (propEntry.GetStatus != null)
                    {
                        var status = VMAfdStatus.Unknown;
                        var result = propEntry.GetStatus(ServerName, out status);
                        VMAfdClientError.Check(result);
                        value = status.ToString();
                    }
                    else if (propEntry.GetString != null)
                    {
                        var ptr    = new IntPtr();
                        var result = propEntry.GetString(ServerName, out ptr);
                        VMAfdClientError.Check(result);
                        value = Marshal.PtrToStringAnsi(ptr);
                        if (value == null)
                        {
                            value = "";
                        }
                    }
                    props [propEntry.Name] = value;
                } catch (VMAfdException exp) {
                    props [propEntry.Name] = exp.Message;
                } catch (VMAfdValueNotSetException) {
                    props [propEntry.Name] = "<Value not set>";
                }
            }
            return(props);
        }
Example #4
0
        public bool SetProperty(string key, string value)
        {
            var entry = VMAfdPropertyDef.PropDefs.Find(x => x.Name == key);

            if (entry == null)
            {
                return(false);
            }
            VMAfdClientError.Check(entry.SetString(ServerName, value));
            return(true);
        }
Example #5
0
        public UInt32 VmDirForceReplication(
            string serverName
            )
        {
            UInt32 result = VMAfdAdaptor.VmAfdForceReplicationA(
                serverName
                );

            VMAfdClientError.Check(result);
            return(result);
        }
Example #6
0
        public UInt32 VmDirMerge(
            string serverName,
            string sourceUserName,
            string sourcePassword,
            string targetHost,
            string targetUserName,
            string targetPassword
            )
        {
            UInt32 result = VMAfdAdaptor.VmAfdVdcMergeA(
                serverName,
                sourceUserName,
                sourcePassword,
                targetHost,
                targetUserName,
                targetPassword
                );

            VMAfdClientError.Check(result);
            return(result);
        }
Example #7
0
        public UInt32 VmDirSplit(
            string serverName,
            string sourceUserName,
            string sourcePassword,
            string targetDomain,
            string targetUserName,
            string targetPassword
            )
        {
            UInt32 result = VMAfdAdaptor.VmAfdVdcSplitA(
                serverName,
                sourceUserName,
                sourcePassword,
                targetDomain,
                targetUserName,
                targetPassword
                );

            //string errMsg = VMAfdAdaptor.VmAfdGetErrorMessageA(result);

            VMAfdClientError.Check(result);
            return(result);
        }
Example #8
0
        public void JoinActiveDirectory(string domain, string computername, string user, string pass)
        {
            var result = VMAfdAdaptor.VmAfdJoinActiveDirectoryA(ServerName, domain, computername, user, pass);

            VMAfdClientError.Check(result);
        }
Example #9
0
        public void JoinVMwareDirectory(string domain, string ou, string user, string pass)
        {
            var result = VMAfdAdaptor.VmAfdJoinVMwareDirectoryA(ServerName, domain, ou, user, pass);

            VMAfdClientError.Check(result);
        }