Faulted state in powershell script

60 Views Asked by At

I have the following problem: I have a script that is plugged into the Task Scheduler on our script server. Its operation is as follows: after running it, it connects to the server, where Azure AD Connect and all the necessary modules are installed, with the command Get- ADSyncServerConfiguration -Path C:.... generates the Connector, MV and SynchronizationRule logs and then copies them back to the script server. While the script works without any problem when called to AD Connect's server, but from the server it doesn't want to work. When it executes the script manually on the script server, it gets the message:

The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. + CategoryInfo : ReadError: (Microsoft.Ident...igurationCmdlet:GetADSyncServerConfigurationCmdlet) [Get-A DSyncServerConfiguration], Synchronization...dationException + FullyQualifiedErrorId : The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.,Microsoft.IdentityManagement.PowerShell.Cmdlet.GetADSyncServer ConfigurationCmdlet + PSComputerName : SERVER_NAME

I will add that the problem occurs after changing the AD Connect server. Previously it was on Windows Server 2012 R2 Std, now a new machine has been put on Windows Server 2019 Std.

I have checked folder permissions, administrative accounts and groups, enabled and disabled TLS and SSL - the problem continues. I completely have no idea why this is happening. Do you have any ideas?

0

There are 0 best solutions below