Login-OnPremisesDataGateway FAILS

Login-OnPremisesDataGateway works for me in PS 5.1 however to use the more peowerful cmdlets need to be working iin PS 7.5

Been trying to use the above cmdlet in PS 7.5.1 ( and also Connect-DataGatewayServiceAccount )

any ideas on where to

 Login-OnPremisesDataGateway

cmdlet Set-OnPremisesDataGatewayUserAccount at command pipeline position 1
Supply values for the following parameters:
EmailAddress: Admin-Gregxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
MethodInvocationException: Exception calling "AcquireToken" with "6" argument(s): "Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core,
Version=4.0.0.0,
Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx'."
WARNING: Acquire token failed.

Welcome to the community :slight_smile:

Disclaimer: I have never used this command or the module it comes in, and have only spent 5 minutes research, so I am far from an expert on this.

I did a quick web search for that command and found this:

where it says this:
The scripts described in this article are for PowerShell version 5. When you use PowerShell version 7, refer to [PowerShell Cmdlets for on-premises data gateway management](https://learn.microsoft.com/en-us/powershell/gateway/overview).

If I’m reading the linked page correctly, it looks like there is a different module for PS7, which is in public preview, with a different command to do what you’re doing Connect-DataGatewayServiceAccount. I’d suggest starting to look into that module and see where that takes you.

1 Like

Thanks fior response, I will look for the new module and keep going with v5 for now, Cheer Z