public void Load(PSHost host) { ManagementAdminService.Initialize(host, true); MFAConfig cfg = ManagementAdminService.ADFSManager.ReadConfiguration(host); MFAKeysConfig otp = cfg.KeysConfig; this.FullQualifiedImplementation = otp.ExternalKeyManager.FullQualifiedImplementation; this.Parameters = otp.ExternalKeyManager.Parameters; }
/// <summary> /// Update method implmentation /// </summary> public void Update(PSHost host) { ManagementAdminService.Initialize(true); MFAConfig cfg = ManagementAdminService.ADFSManager.Config; MFAKeysConfig otp = cfg.KeysConfig; otp.ExternalKeyManager.FullQualifiedImplementation = this.FullQualifiedImplementation; otp.ExternalKeyManager.Parameters = this.Parameters; ManagementAdminService.ADFSManager.WriteConfiguration(host); using (MailSlotClient mailslot = new MailSlotClient()) { mailslot.SendNotification(0xAA); } }
/// <summary> /// Update method implmentation /// </summary> public void Load(PSHost host) { ManagementAdminService.Initialize(host, true); MFAConfig cfg = ManagementAdminService.ADFSManager.ReadConfiguration(host); MFAKeysConfig keys = cfg.KeysConfig; IsDirty = cfg.IsDirty; this.CertificateThumbprint = keys.CertificateThumbprint; this.CertificateValidity = keys.CertificateValidity; this.KeyFormat = keys.KeyFormat; this.KeyGenerator = keys.KeyGenerator; this.KeySize = keys.KeySize; this.ExternalKeyManager = (MMCExternalKeyManager)keys.ExternalKeyManager; }
/// <summary> /// Update method implmentation /// </summary> public void Update(PSHost host) { ManagementAdminService.Initialize(true); MFAConfig cfg = ManagementAdminService.ADFSManager.Config; MFAKeysConfig keys = cfg.KeysConfig; cfg.IsDirty = true; keys.CertificateThumbprint = this.CertificateThumbprint; keys.CertificateValidity = this.CertificateValidity; keys.KeyFormat = this.KeyFormat; keys.KeyGenerator = this.KeyGenerator; keys.KeySize = this.KeySize; keys.ExternalKeyManager = (MFAExternalKeyManager)this.ExternalKeyManager; ManagementAdminService.ADFSManager.WriteConfiguration(host); using (MailSlotClient mailslot = new MailSlotClient()) { mailslot.SendNotification(0xAA); } }