CCPA Deletion Script Issues

Copper Contributor

My team and I have been using the script below to purge items for our CCPA deletion requests. First we would run an eDiscovery of any listed information on Microsoft Purview and then run this script (With the name of the search entered). 


This has worked great up until about a month ago... Now we are running into all sorts of issues - We can't even get passed the first line without this error: 


New-PSSession : [] Connecting to remote server failed with the following error message : For more information, see the
about_Remote_Troubleshooting Help topic.



Here is the script we are running *(Line by line)*:


$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection


#Enter O365 username and pw


Import-PSSession $Session


#To purge data

New-ComplianceSearchAction -SearchName "search name" -Purge -PurgeType HardDelete

#To check status of data

Get-ComplianceSearch -identity "search name"





Any help or guidance would be greatly appreciated!


0 Replies