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.
Locked
User avatar
jpizzuco
Posts: 5
Joined: Mon Feb 16, 2015 1:40 pm

Skype for Business

Post by jpizzuco » Tue Jan 08, 2019 1:37 pm

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

User avatar
jvierra
Posts: 13681
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Skype for Business

Post by jvierra » Tue Jan 08, 2019 1:45 pm

What is the error message?

User avatar
jvierra
Posts: 13681
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Skype for Business

Post by jvierra » Tue Jan 08, 2019 1:48 pm

Before you pursue this farther you should read the following:

https://docs.microsoft.com/en-us/office ... powershell

User avatar
jpizzuco
Posts: 5
Joined: Mon Feb 16, 2015 1:40 pm

Re: Skype for Business

Post by jpizzuco » Tue Jan 08, 2019 1:50 pm

that article is for Skype for business online , we are using on-prem

User avatar
jvierra
Posts: 13681
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Skype for Business

Post by jvierra » Tue Jan 08, 2019 2:20 pm

Then this is the link to start with:

https://docs.microsoft.com/en-us/skypef ... ment-tools

User avatar
jvierra
Posts: 13681
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Skype for Business

Post by jvierra » Tue Jan 08, 2019 2:22 pm

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

Locked