title: The term 'Get-CsUser' is not recognized as the name of a cmdlet, function, script file, or operable program
body: <p>I am getting below exception if run lync powershell command "Get-CsUser". I am running application with administrator and on machine which have lync powershell.</p>
  
  <blockquote>
    <p>System.Management.Automation.CommandNotFoundException: The term
    'Get-CsUser' is not recognized as the name of a cmdlet, function,
    script file, or operable program. Check the spelling of the name, or
    if a path was included, verify that the path is correct and try again.
    at
    System.Management.Automation.CommandDiscovery.LookupCommandInfo(String
    commandName, CommandOrigin commandOrigin)    at
    System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String
    commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)<br>
    at
    System.Management.Automation.Runspaces.Command.CreateCommandProcessor(ExecutionContext
    executionContext, CommandFactory commandFactory, Boolean addToHistory)
    at
    System.Management.Automation.Runspaces.LocalPipeline.CreatePipelineProcessor()
    at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
    at
    System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()</p>
  </blockquote>
  
  <p><strong>sample code:</strong></p>
  
  <pre><code>using (Runspace runspace = RunspaceFactory.CreateRunspace(initial))
  {
  
              //// open it
              runspace.Open();
  
  
              using (PowerShell ps = PowerShell.Create())
              {
                  ps.Runspace = runspace;
                  ps.AddScript("import-module 'C:\\Program Files\\Common Files\\Microsoft 
                  ps.AddCommand("Get-CsUser");
                  Collection&lt;PSObject&gt; results = ps.Invoke();
                  foreach (PSObject obj in results)
                  {
                      stringBuilder.AppendLine(obj.ToString());
                  }
                  runspace.Close();
              }
  }
  </code></pre>
  
  <p>any suggestion to  fix this ???</p>