Skype for Business

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
jpizzuco
Posts: 7
Last visit: Sat Jan 23, 2021 7:48 am

Skype for Business

Post by jpizzuco »

Hi Guys,
I'm using PS S2019
I'm trying to connect to our skype for business server 2015 to delete a user account but every time I try it doesn't seem to work, this is my script below

$button1_Click = {
$cred = Get-Credential DOMAIN\UserAccount that has rights
$session1 = New-PSSession -ConnectionURI "https://skype Server/OcsPowershell" -credential $cred
import-PSSession $session1 -AllowClobber
sleep 10
$richtextbox1.AppendText("Connecting to skype, wait 10secs`n")
$EnterUser = Read-Host "Enter Username"
$richtextbox1.AppendText("$EnterUser`n")
$progressbar1.Value = 10
$SamAccountName = (get-csaduser $EnterUser | select SamAccountName | ft -hidetableheaders | Out-String).trim()
$richtextbox1.AppendText("$SamAccountName`n")
Disable-CsUser -identity "$SamAccountName"
Remove-PSSession $session1
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Skype for Business

Post by jvierra »

What is the error message?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Skype for Business

Post by jvierra »

Before you pursue this farther you should read the following:

https://docs.microsoft.com/en-us/office ... powershell
User avatar
jpizzuco
Posts: 7
Last visit: Sat Jan 23, 2021 7:48 am

Re: Skype for Business

Post by jpizzuco »

that article is for Skype for business online , we are using on-prem
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Skype for Business

Post by jvierra »

Then this is the link to start with:

https://docs.microsoft.com/en-us/skypef ... ment-tools
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Skype for Business

Post by jvierra »

Here is a detailed doc on how to set up connections and how to connect with PowerShell.

https://docops.ca.com/ca-identity-manag ... erver-lync
This topic is 5 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked