mirror of
https://github.com/Pro/dkim-exchange.git
synced 2026-04-25 08:55:52 +03:00
[GH-ISSUE #47] Wrong Powershell credentials #32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @julianmaria on GitHub (Jul 10, 2014).
Original GitHub issue: https://github.com/Pro/dkim-exchange/issues/47
im trying to install 2.0.0-beta.2 with Configuration.DkimSigner.exe
Either if I choose to download from GUI or to install from zip, the same happens:
Error at Copying new files:
"Value can not be null"
"Parameter: path2"
Im using EDGE ROLE of Exchange Server 2010 SP2 (spanish) in Windows Server 2008 R2
The gui seems to start copying files to "C:\Program Files\Exchange DkimSigner\Configuration"
the files copied until error are:
Configuration.DkimSigner.exe
Configuration.DkimSigner.pdb
Configuration.DkimSigner.exe.config
Ionic.Zip.dll
System.Management.Automation.dll
Hope this may help
@Pro commented on GitHub (Jul 11, 2014):
Thanks for your very detailed report!
Based on your infos it looks like the Exception is caused by: https://github.com/Pro/dkim-exchange/blob/master/Src/Configuration.DkimSigner/UpgradeWindow.cs#L200
meaning that the
directoryFromExchangeVersionfunction couldn't detect the Exchange Version.I wrote a small App to check the functionality of this function: https://github.com/Pro/dkim-exchange/blob/master/Src/Configuration.DkimSigner/ExchangeHelper.cs#L31
(replace the .png extension with .exe)
Can you please download it and post the output:
@Pro commented on GitHub (Jul 11, 2014):
@julianmaria forgot to mention you in previous message so that you get the notification. Just to be sure
@julianmaria commented on GitHub (Jul 11, 2014):
Domain: corp.local
EXCEPTION: Error de inicio de sesión: nombre de usuario desconocido o contraseña incorrecta.
(EXCEPTION: Error in login session: user unknown or incorrect pass)
Im using a Local Administrator (EDGE Server is Not part of the domain, following MS best practices)
My exact Exchange Server Version (2010, SP2)
"14.02.0247.005"
may be is that: it should be 14.02, and not 14.2
PATH of Exchange Server:
"c:\Program Files\Microsoft\Exchange Server\V14" (x64 of course)
@Pro commented on GitHub (Jul 11, 2014):
Thanks for your info.
The problem is that your Exchange Server isn't part of the domain but the code only detects Exchange Servers which are within the domain of the local machine which is wrong.
I already found a solution for this problem and will upload a new beta version shortly.
@Pro commented on GitHub (Jul 11, 2014):
@julianmaria the problem should be fixed in 2.0.0-beta.3
Could you please try again using these instructions and give feedback? https://github.com/Pro/dkim-exchange/blob/master/INSTALL_2.md
Thanks!
@julianmaria commented on GitHub (Jul 11, 2014):
Of course:
I was checking the code and yes:
checkExchangeVersionInstalled() in ExchangeHelper.cs returns: "Not Installed" because u use LDAP to detect Exchange Version and my Edge Server is not part of the Domain
let me try beta 3 :>
Thank you :D
@julianmaria commented on GitHub (Jul 11, 2014):
The same as 1st Post:
With
//ADD
String fuckingshitnotfunctioning = ExchangeHelper.checkExchangeVersionInstalled();
MessageBox.Show(fuckingshitnotfunctioning, "ME");
//uptohere
I recieve this:

It seems there's some problems with Authentication/trustedhosts when running Exchange Powershell Console commands from code.
From EPC u can see the same u are traying to obtain from code

@Pro commented on GitHub (Jul 11, 2014):
Damn it!
This problem will occur with all the powershell commands (not only getting the version, but also registering the agent and so on).
I somehow need to set the correct credentials at this line: https://github.com/Pro/dkim-exchange/blob/master/Src/Configuration.DkimSigner/ExchangeHelper.cs#L90
(If they are set to
nullit should use the current windows user, http://blogs.msdn.com/b/dvespa/archive/2010/02/22/how-to-use-windows-authentication-with-the-pscredential-class.aspx)Will do some research...
@Pro commented on GitHub (Jul 11, 2014):
@julianmaria do you have the possibility to compile and test the code?
If yes, then could you add
connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Kerberos;to https://github.com/Pro/dkim-exchange/blob/master/Src/Configuration.DkimSigner/ExchangeHelper.cs#L92 at line 92 (right after the constructor)
@julianmaria commented on GitHub (Jul 11, 2014):
let me see. I was compiling the code before trying to figure it out. Let me see
@julianmaria commented on GitHub (Jul 11, 2014):
it says we cannot use Kerberos as Auth method cause Machine is not member of the domain
See: http://stackoverflow.com/questions/16010091/connecting-to-remote-server-failed-using-winrm-from-powershell
@Pro commented on GitHub (Jul 11, 2014):
Well, that was a wild guess, maybe another AuthenticationMechanism works, e.g. Default (http://msdn.microsoft.com/en-us/library/system.management.automation.runspaces.authenticationmechanism%28v=vs.85%29.aspx)
Another wild guess: try to set
hostName = "localhost"at https://github.com/Pro/dkim-exchange/blob/master/Src/Configuration.DkimSigner/ExchangeHelper.cs#L88Otherwise I'll have to implement a dialog to ask the user for the correct credentials which is quite ugly: http://stackoverflow.com/a/1624590/869402
http://farnet.googlecode.com/svn/!svn/bc/308/trunk/PowerShellFar/NativeMethods.cs
Here's another example where the credentials are set from a string:
@julianmaria commented on GitHub (Jul 11, 2014):
I dont know if there's another option for Edge Servers. it doesnt matter to put credentials to authenticate in this cases
@Pro commented on GitHub (Jul 14, 2014):
Ok, we then should first try to execute powershell commands without asking the user. If this fails, we will ask the user for Username and Password. Something like a 'TryAuthenticate' method. This will take some time.
@AlexLaroche commented on GitHub (Jul 27, 2014):
May the problem would be solve with next beta. I need to finish re-implement all functions but I have rewrited the most part of ExchangeHelper class in a new class ExchangeServer and I have changed the powershell invocation. I think the problem would be fix. I hope to be able to post a new beta release in a week.
@Pro commented on GitHub (Aug 27, 2014):
@julianmaria Can you test the current binary within this commit if it is working for you:
https://github.com/Pro/dkim-exchange/tree/master/Src/Configuration.DkimSigner/bin/Release
(You need all the files from Release directory)
@Pro commented on GitHub (Sep 11, 2014):
We changed a lot in the new release 2.0.2
Please check that one if it is working. If not, please reopen this issue.