We're building a terminations script using PowerShell and myself and one of the other admins have run into a very strange error when trying to run some Lync cmdlets remotely via PowerShell. We create the PSSession normally and import it into the current session. We then want to export the terminated user's Lync buddy list before we remove them from Lync, but when we run the cmdlet, it throws the error below.
PS C:\PowerShell> Export-CsUserData -PoolFqdn "fepool.contoso.com" -FileName "c:\powershell\nick.zip" -UserFil
ter "nick@contoso.com"
Cannot find a provider with the name 'Microsoft.PowerShell.Core\FileSystem'.
+ CategoryInfo : ObjectNotFound: (Microsoft.PowerShell.Core\FileSystem:String) [Export-CsUserData], Provi
derNotFoundException
+ FullyQualifiedErrorId : ProviderNotFound,Microsoft.Rtc.Management.BlobStore.ExportOcsUserStoreDataCmdlet
+ PSComputerName : feserver1.contoso.com
I've worked with PowerShell a lot and we were both scratching our heads over this one, because all the other Lync cmdlets we run work, and we can Export-CsRgsConfiguration to the same folder just fine. We've tried on two different workstations and we can both confirm that our local PSProviders are all good, but I don't know of a good way to check what PSProviders are loaded inside the remote session. Has anyone else run into this? Any thoughts or alternative ways to export the file? Thanks in advance!