Skype for Business
Posted: Tue Jan 08, 2019 12: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
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