Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Unable to login with Powershell on Data Gateway server

Unable to login with Powershell on Data gateway server. I get the fol err msg. It used to work fine last week. I installed an update this morning.

 

Add-Type : Cannot bind parameter 'Path' to the target. Exception setting "Path": "Cannot find path 'C:\Program
Files\On-premises data gateway\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll' because it does not
exist."
At C:\Program Files\On-premises data gateway\OnPremisesDataGatewayHAMgmt.psm1:195 char:20
+ ... -Type -Path $( join-path $GWDir "Microsoft.IdentityModel.Clients.Acti ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Add-Type], ParameterBindingException
+ FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.AddTypeCommand

Method invocation failed because [Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext] does not
contain a method named 'AcquireToken'.
At C:\Program Files\On-premises data gateway\OnPremisesDataGatewayHAMgmt.psm1:232 char:12
+ return $context.AcquireToken($script:adResource, $script:adClient ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound

7 REPLIES 7
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

Sorry for that, After we update to the Version of October, we run into the same issue as yours, we will notice you if we found the reason.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous ,

 

After we uninstall the October Verision and install the September, this feature worked again, then we upgrade to the October Verision use the same installion pack as previous, then it still worked.

 

Could you please check the Following Files in you Installation Dictory?

Microsoft.IdentityModel.Clients.ActiveDirectory.dll

Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll

 

If you miss those, you could try to re-install the On-Premises Data Gateway (Please remember always make backup)

 

Update: we test with the Version of 3000.10.232.0

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

It worked fine on my side based on my test, do you get the error in the import module step or the Login command? What the version  of On-Premisies Data Gateway you are using?

 

1.PNG

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @v-lid-msft 

i have a issue when I trying remove gateway on powerbi by powershell.

After i filling email, the error displayed with message: 

"Method invocation failed because Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext dose not contain the method nameAcquiredToken"

 

Please help me fix it

Tks 

Hi @Anonymous ,


How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I ran into similar issue and re-installed Oct 2019 version 4 x already and issue remains.  Still not seeing Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll file.   What is your recommendation ?

Hi @SN-pbi ,

 

We just uninstalled the On-Premises Data Gateway and install it again, we still have the two files. The version we test with is 3000.10.248 (October 2019(Release 2))

 

10.PNG

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors