First of all you need to get an account that has the right permissions to create a Lync account in Lync server, then we need to create a windows remote connection to the Lync server, so we can execute PowerShell commends in Lync Management Shell:
SecureString password = new SecureString();
string username = "user";
string str_password = "password";
string lyncserver = "lyncserver.mytestdomain.loc";
string liveIdconnectionUri = "https://" + lyncserver + "/OcsPowershell";
foreach (char x in str_password)
PSCredential credential = new PSCredential(username, password);
WSManConnectionInfo connectionInfo = new WSManConnectionInfo((new Uri(liveIdconnectionUri)), "http://schemas.microsoft.com/powershell/Microsoft.PowerShell", credential);
connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Default;
Runspace runspace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(connectionInfo);
PowerShell powershell = PowerShell.Create();
powershell.Runspace = runspace;
After creating the connection, it’s time to execute the command (Enable-CsUser) to create a Lync account:
PSCommand command1 = new PSCommand();
command1.AddParameter("SipDomain", "MYTESTDOMAIN.loc ");
powershell.Commands = command1;
To make sure that the account created in Lync server refer to Lync attributes in the Active Directory for the user.
I hope you get the benefit from this post, please contact me for any question.
iOS devices became widely used in an enterprise level daily-work (e.g BYOD), due to this we need to guarentee secure communications and data in these devices. One way of doing that is using digital certificates to encrypt/decrypt, sign and authenticate communications and data.
In iOS devices there are two types of certificate stores:
1- App Certificates Store: this store is embedded in the app space and can be used by the app only.(not exposed to the system level)
2- System Certificate Store: this store is used in the system level (called Profiles). This store located in Settings->General->Profiles and used for Microsoft Exchange ActiveSync, VPN, and Wi-Fi networks.
Apple offers APIs for the App Certificate Store to be used by developers to deploy and retrieve certificates from this store.
For the second type of store(System Certificate Store) Apple does not offer any API to communication with this store, there are four ways to deploy certificates to this store (not programmatically):
1- Configuration Profiles: pre-configured profiles that used to distribute settings.
2- Using Simple Certificate Enrollment Protocol (SCEP): this protocol enables Over-the-Air Enrollment of digital certificates, mainly used for routers.
3- Email Attachment: send the certificate from a desktop or mac as an email attachment.
4- Using Safari: browse the certificate using Safari.
But Apple does not provide any API to deploy/retrieve certificates from the System Store(Profiles). After I did my research I found a workaround that worked for me to deploy a certificate to the System Certificate Store from xCode directly.
Here's what you will need to do, first, to create a web-server inside your App, then save the certificate in this web-server and open it's URL. When the page launches, Safari will recognize that it's a certificate, then the System Profiles will pop up and ask the user to install the certificate. After the user install the certificate it will be saved to the Profiles and the certificate can be used in the System level ( Mail, VPN, Wi-Fi and others).
I spent a lot of time and research efforts to find this workaround, I hope you will get benefit from my results.
Please contact me for any question.