Asked by:
Skype / PowerShell not displaying some results

Question
-
I am following this article:
Connecting to Skype for Business Online by using Windows PowerShell
https://technet.microsoft.com/en-us/library/dn362795(v=ocs.15).aspx
At the "Get-Module" step, nothing displays in the PowerShell window.
If the results of the are sent to a file, they show up.
Get-Module | Out-File C:\temp\module2.txtThe results are the same if the script is run within the PowerShell ISE or Lync Server Management Shell
How do I get results to show up in the PowerShell window?
**************
Import-Module LyncOnlineConnector
$credential = Get-Credential "XXXX@XXXX.com" -Message "XXXX@XXXX.com"
$credential
$session = New-CsOnlineSession -Credential $credential -Verbose
Import-PSSession $session -Verbose
Get-Module
Get-Module | Out-File C:\temp\module2.txt
Remove-PSSession $session***********
Results:UserName Password
-------- --------
XXXX@XXXX.com System.Security.SecureString
VERBOSE: AdminDomain = 'XXXX.onmicrosoft.com'
VERBOSE: Discovering PowerShell endpoint URI
VERBOSE: TargetUri = 'https://admin0a.online.lync.com/OcsPowershellLiveId'
VERBOSE: Requesting authentication token
VERBOSE: Success
VERBOSE: Initializing remote session
VERBOSE: Success
WARNING: Proxy creation has been skipped for the following command: 'Copy-CsVoicePolicy, Disable-CsMeetingRoom, Enable-CsMeetingRoom, Get-CsClientPolicy, Get-CsConferencingPolicy, Get-CsDialPlan, Get-CsExternalAccessPolicy, G
et-CsExUmContact, Get-CsHostedVoicemailPolicy, Get-CsHostingProvider, Get-CsImFilterConfiguration, Get-CsMeetingConfiguration, Get-CsMeetingRoom, Get-CsOAuthConfiguration, Get-CsPresencePolicy, Get-CsPrivacyConfiguration, Get
-CsPushNotificationConfiguration, Get-CsUserAcp, Get-CsUserServicesPolicy, Get-CsVoicePolicy, Get-CsVoiceRoutingPolicy, Grant-CsClientPolicy, Grant-CsConferencingPolicy, Grant-CsDialPlan, Grant-CsExternalAccessPolicy, Grant-C
sHostedVoicemailPolicy, Grant-CsVoicePolicy, Grant-CsVoiceRoutingPolicy, Invoke-CsUcsRollback, New-CsExUmContact, Remove-CsExUmContact, Remove-CsUserAcp, Remove-CsVoicePolicy, Set-CsClientPolicy, Set-CsExUmContact, Set-CsMeet
ingConfiguration, Set-CsMeetingRoom, Set-CsOAuthConfiguration, Set-CsPrivacyConfiguration, Set-CsPushNotificationConfiguration, Set-CsUser, Set-CsUserAcp, Set-CsUserServicesPolicy', because it would shadow an existing local c
ommand. Use the AllowClobber parameter if you want to shadow existing local commands.****************
Here's a second example with -AllowClobber
Import-Module LyncOnlineConnector
$credential = Get-Credential "XXXX@XXXX.com" -Message "XXXX@XXXX.com"
$credential
$session = New-CsOnlineSession -Credential $credential -Verbose
Import-PSSession $session -Verbose -AllowClobber
Get-Module
Get-Module | Out-File C:\temp\module3.txt***********************
Results:
UserName Password
-------- --------
XXXX@XXXX.com System.Security.SecureString
VERBOSE: AdminDomain = 'XXXX.onmicrosoft.com'
VERBOSE: Discovering PowerShell endpoint URI
VERBOSE: TargetUri = 'https://admin0a.online.lync.com/OcsPowershellLiveId'
VERBOSE: Requesting authentication token
VERBOSE: Success
VERBOSE: Initializing remote session
VERBOSE: SuccessFriday, August 12, 2016 4:26 PM
All replies
-
Do you get any results from any of the commands? Do you see results if you simply run get-service?
Please remember, if you see a post that helped you please click "Vote" on the left side of the response, and if it answered your question please click "Mark As Answer". SWC Unified Communications This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, SWC, their employees, or other MVPs.
Friday, August 12, 2016 4:33 PM -
Yes. I give examples in the 2 results sections. $credentials displays results.
$session = New-CsOnlineSession -Credential $credential -Verbose gives the lines that say VERBOSE:
Friday, August 12, 2016 5:18 PM -
Hmmm... well, if everything else works other than the output, you should be fine. Are you having trouble once it's loaded running commands?
Please remember, if you see a post that helped you please click "Vote" on the left side of the response, and if it answered your question please click "Mark As Answer". SWC Unified Communications This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, SWC, their employees, or other MVPs.
Friday, August 12, 2016 6:48 PM -
Hi Dude man,
Yes, agree with Anthony.
Did you try to use another normal powershell to do a test?
Please make sure your powershell with the latest version and ensure the user run the command is the part of CSAdministroators/RTCUniversalServeadmins
Here is an article for your reference
https://dmunified.com/2013/11/06/lync-2013-management-shell-missing-prompt/
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
Best regards,
Alice Wang
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.
Alice Wang
TechNet Community Support- Proposed as answer by Alice-Wang Monday, August 22, 2016 9:49 AM
- Marked as answer by Alice-Wang Friday, August 26, 2016 9:56 AM
- Unmarked as answer by Dude man Wednesday, September 28, 2016 8:09 PM
Monday, August 15, 2016 2:45 AM -
The commands work. Output is not displayed in the PowerShell window.
I can output to a file.Wednesday, September 28, 2016 8:09 PM -
Yes. I've used another normal PowerShell as a test.
This user is a member of RTCUniversalServerAdmins
The article is describing a different situation. He does not see a prompt. I do see a promptWednesday, September 28, 2016 8:12 PM -
Out of curiousity, does tee-object work: https://technet.microsoft.com/en-us/library/ee177014.aspx
or
Adding *>&1 to the end of the command? https://technet.microsoft.com/en-us/library/hh847746.aspx?f=255&MSPPError=-2147217396
Please remember, if you see a post that helped you please click "Vote" on the left side of the response, and if it answered your question please click "Mark As Answer". SWC Unified Communications This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, SWC, their employees, or other MVPs.
Wednesday, September 28, 2016 8:15 PM